Compartilhar via


CertGetSubjectCertificateFromStore (Windows CE 5.0)

Send Feedback

This function returns from a certificate store a subject certificate context uniquely identified by its issuer and serial number.

PCCERT_CONTEXT WINAPI CertGetSubjectCertificateFromStore(HCERTSTOREhCertStore,DWORDdwCertEncodingType,PCERT_INFOpCertId);

Parameters

  • hCertStore
    [in] Handle to a certificate store.
  • dwCertEncodingType
    [in] Specifies the type of encoding used. Currently, only X509_ASN_ENCODING is used; however, additional encoding types may be added in the future.
  • pCertId
    [in] Pointer to a CERT_INFO structure. Only the Issuer and SerialNumber members are used.

Return Values

If the function succeeds, the return value is a pointer to a read-only CERT_CONTEXT. The CERT_CONTEXT structure must be freed by calling the CertFreeCertificateContext function.

The returned certificate might not be valid. Usually, it is verified when using CertGetIssuerCertificateFromStore to get its issuer certificate.

For extended error information, call the GetLastError function.

The GetLastError function can return CRYPT_E_NOT_FOUND, which mean that the subject certificate was not found in the store.

Remarks

The CertDuplicateCertificateContext function can be called to make a duplicate certificate.

The desktop operating system supports the flag PKCS_7_ASN_ENCODING, but Windows CE does not and ignores the flag when it is specified.

Requirements

OS Versions: Windows CE 3.0 and later.
Header: Wincrypt.h.
Link Library: Crypt32.lib.

See Also

CertDuplicateCertificateContext | CertFreeCertificateContext | CertGetIssuerCertificateFromStore | CERT_CONTEXT | CERT_INFO

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.