CertFindSubjectInSortedCTL function (wincrypt.h)

The CertFindSubjectInSortedCTL function attempts to find the specified subject in a sorted certificate trust list (CTL). A subject can be identified either by the certificate's whole context or by any unique identifier of the certificate's subject, such as the SHA1 hash of the certificate's issuer and serial number.


BOOL CertFindSubjectInSortedCTL(
  [in]  PCRYPT_DATA_BLOB pSubjectIdentifier,
  [in]  PCCTL_CONTEXT    pCtlContext,
  [in]  DWORD            dwFlags,
  [in]  void             *pvReserved,
  [out] PCRYPT_DER_BLOB  pEncodedAttributes


[in] pSubjectIdentifier

A pointer to a CRYPT_DATA_BLOB structure uniquely identifying the subject. The information in this structure can be a hash or any unique byte sequence.

[in] pCtlContext

A pointer to the CTL_CONTEXT structure to be searched.

[in] dwFlags

Reserved for future use and must be NULL.

[in] pvReserved

Reserved for future use and must be NULL.

[out] pEncodedAttributes

A pointer to a CRYPT_DER_BLOB structure containing a byte count and a pointer to the subject's encoded attributes.

Return value

If the function succeeds and the subject identifier exists in the CTL, the return value is TRUE.

If the function fails and does not locate a matching subject identifier, the return value is FALSE.


Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header wincrypt.h
Library Crypt32.lib
DLL Crypt32.dll

See also



Certificate and Certificate Store Maintenance Functions