EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

CryptGetMessageCertificates function

The CryptGetMessageCertificates function returns the handle of an open certificate store containing the message's certificates and CRLs. This function calls CertOpenStore using provider type CERT_STORE_PROV_PKCS7 as its lpszStoreProvider parameter.

Syntax


HCERTSTORE 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. It is always acceptable to specify both the certificate and 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 should be set to NULL.

Windows Server 2003 and Windows XP:  Handle of the CSP passed to CertOpenStore. For more information, see CertOpenStore.

Unless there is a strong reason for passing a specific cryptographic provider in hCryptProv, pass zero to cause the default RSA or DSS provider to be acquired.

This parameter's data type is HCRYPTPROV.

dwFlags [in]

Flags passed to CertOpenStore. For more information, see CertOpenStore.

pbSignedBlob [in]

A pointer to a buffered CRYPT_INTEGER_BLOB structure that contains the signed message.

cbSignedBlob [in]

The size, in bytes, of the signed message.

Return value

Returns the certificate store containing the message's certificates and CRLs. For an error, NULL is returned.

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

Return codeDescription
E_INVALIDARG

Invalid message and certificate encoding types. Currently only PKCS_7_ASN_ENCODING and X509_ASN_ENCODING are supported.

 

If the function fails, 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

Use GetLastError to determine the reason for any errors.

Examples

For an example that uses this function, see Example C Program: Setting and Getting Certificate Store Properties.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Wincrypt.h

Library

Crypt32.lib

DLL

Crypt32.dll

See also

Simplified Message Functions
CryptVerifyMessageSignature

 

 

Contribuições da comunidade

ADICIONAR
Mostrar:
© 2014 Microsoft