3.1.1.11.2.10 DecodeClaimsSet

 procedure DecodeClaimsSet (
     pClaimsBlob : ADDRESS OF CLAIMS_BLOB,
     pClaimsSet : ADDRESS OF CLAIMS_SET)

This method decodes the given CLAIMS_BLOB structure into a CLAIMS_SET structure and performs various validations on it. Upon successful validation, the output CLAIMS_SET structure is filled. In the case of errors, an empty output CLAIMS_SET structure is returned.

pClaimsBlob: The address of a CLAIMS_BLOB structure that is to be decoded.

pClaimsSet: The address of a CLAIMS_SET structure that receives the decoded output.

Return Values: This procedure does not return a value.

Logical Processing:

 claimsSetMetaData : CLAIMS_SET_METADATA;
 pByteArray : BYTE[];
 ulBufferSizeinBytes: ULONG;
  
 claimsSetMetaData := null;
 pByteArray := null;
 ulBufferSizeinBytes := 0;
 pClaimsSet^ := null;
  
 if (pClaimsBlob^.ulBlobSizeinBytes = 0)
     return;
 endif
 NdrDecode (
     pClaimsBlob^.EncodedBlob,
     pClaimsBlob^.ulBlobSizeinBytes,
     ADDRESS OF claimsSetMetadata);
  
 if (claimsSetMetadata.ulClaimsSetSize = 0)
    return;
 endif
  
 RunCompressionAlgorithm(
               FALSE,
               claimsSetMetadata.usCompressionFormat,
               claimsSetMetadata.ClaimsSet,
               claimsSetMetadata.ulClaimsSetSize,
               ADDRESS OF pByteArray,
               ADDRESS OF ulBufferSizeinBytes);
  
 if (ulBufferSizeinBytes = 0 ||
     ulBufferSizeinBytes ≠ claimsSetMetadata.ulUncompressedClaimsSetSize)
     return;
 endif
  
 NdrDecode (pByteArray, ulBufferSizeinBytes, pClaimsSet);
  
 return;