Share via


CryptGetMessageCertificates (Compact 2013)

3/28/2014

This function returns the handle of an open certificate store that contains the message certificates.

Syntax

BOOL WINAPI CryptGetMessageCertificates(
    __in DWORD dwMsgAndCertEncodingType,
    __in HCRYPTPROV_LEGACY hCryptProv,
    __in DWORD dwFlags,
    __in const BYTE *pbSignedBlob,
    __in DWORD cbSignedBlob
);

Parameters

  • dwMsgAndCertEncodingType
    [in] Specifies the encoding type used. You can specify both the certificate and the message encoding types by combining them with a bitwise OR operation as shown in the following example:

    X509_ASN_ENCODING | PKCS_7_ASN_ENCODING

    Currently defined encoding types are:

    X509_ASN_ENCODING

    PKCS_7_ASN_ENCODING

  • hCryptProv
    [in] This parameter is not used and must be set to NULL.
  • pbSignedBlob
    [in] Pointer to a buffered CRYPT_INTEGER_BLOB structure that contains the signed message.
  • cbSignedBlob
    [in] Size, in bytes, of the signed message.

Return Value

If successful, returns the certificate store that contains the message certificates and certificate revocation lists (CRLs); otherwise, returns NULL.

The following table lists the error code that is most commonly returned by the GetLastError function.

Error code

Description

E_INVALIDARG

Invalid message and certificate encoding types. Only PKCS_7_ASN_ENCODING and X509_ASN_ENCODING are supported.

If the function was not successful, GetLastError may return an Abstract Syntax Notation One (ASN.1) encoding/decoding error. For information about these errors, see ASN.1 Encoding/Decoding Return Values.

Remarks

This function calls CertOpenStore by using the provider type CERT_STORE_PROV_PKCS7 as its lpszStoreProvider parameter.

Use GetLastError to determine the reason for any errors.

See Also

Reference

Certificates Functions