CertFindSubjectInSortedCTL

[This is preliminary documentation and subject to change.]

The CertFindSubjectInSortedCTL function attempts to find the specified subject in a sorted CTL.

#include <wincrypt.h>
BOOL WINAPI CertFindSubjectInSortedCTL(
  PCRYPT_DATA_BLOB pSubjectIdentifier,  // in
  PCCTL_CONTEXT pCtlContext,            // in
  DWORD dwFlags,                        // in
  void *pvReserved,                     // in
  PCRYPT_DER_BLOB pEncodedAttributes    // out, optional
);
 

Parameters

pSubjectIdentifier
Pointer to a CRYPT_DATA_BLOB structure uniquely identifying the subject. It can be a hash or any unique byte sequence. See BLOB Structure.
pCtlContext
Pointer to the CTL_CONTEXT to be searched.
dwFlags
Flag values.

This parameter is reserved for future use and should always be zero.

pvReserved
This parameter is reserved for future use and must be NULL.
pEncodedAttributes
Pointer to a CRYPT_DER_BLOB structure containing a byte count and a pointer to the Subject's encoded attributes. See BLOB Structure.

Return Values

TRUE if the SubjectIdentifier exists in the CTL, FALSE if the function does not locate a matching SubjectIdentifier.

Example

// EXAMPLE CODE FOR USING CertFindSubjectInSortedCTL().
// Assume pointers to the Subject Blob (pSubjectIdentifier) and
// the PCCTL_CONTEXT (pCtlContext) are initialized elsewhere.
// Declare and initialize.
PCRYPT_DER_BLOB pSubjectIdentifier;
// Pointer to a BLOB structure
                                //   identifiable to the subject.
                                //   Initialized elsewhere
PCCTL_CONTEXT pCtlContext;      // Pointer to a CTL context.
                                //   Initialized elsewhere
CRYPT_DER_BLOB EncodedAttributes;
// Pointer to a BLOB struture
                                //   containing the found Subject's
                                //   encoded attributes.
BOOL fResult;                   // Returns TRUE if function finds a
                                //   SubjectIdentifier in the CTL.
                                //   FALSE if the SubjectIdentifier is
                                //   not found.
// Function call to CertFindSubjectInSortedCTL().
fResult= CertFindSubjectInSortedCTL(
          pSubjectIdentifier,   // in- Pointer to a BLOB struture,
                                //   identifying the subject.
          pCtlContext,          // in- Pointer to the CTL_CONTEXT
                                //   to be searched.
          0,                    // in- dwFlags- reserved, set to 0
          NULL,                 // in- pvReserved- reserved, set to
                                //   NULL
&EncodedAttributes);            // out, optional- Pointer to
//   attributes BLOB structure
if(fResult){  // TRUE returned- the subject was found in the CTL.
printf("The subject was found in the sorted CTL.\n");
    }
else {        // FALSE returned- the subject was not found in the CTL.
printf("The subject was not found in the sorted CTL.\n");
    }
 

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Unsupported.
  Windows CE: Unsupported.
  Header: Declared in wincrypt.h.
  Import Library: Use crypt32.lib.

See Also

CertEnumSubjectInSortedCTL