PFN_CRYPT_GET_SIGNER_CERTIFICATE callback function (wincrypt.h)

The CryptGetSignerCertificateCallback user supplied callback function is used with the CRYPT_VERIFY_MESSAGE_PARA structure to get and verify a message signer's certificate.

Syntax

PFN_CRYPT_GET_SIGNER_CERTIFICATE PfnCryptGetSignerCertificate;

PCCERT_CONTEXT PfnCryptGetSignerCertificate(
  [in] void *pvGetArg,
  [in] DWORD dwCertEncodingType,
  [in] PCERT_INFO pSignerId,
  [in] HCERTSTORE hMsgCertStore
)
{...}

Parameters

[in] pvGetArg

A pointer to user-defined data passed on to the verification function as specified in the CRYPT_VERIFY_MESSAGE_PARA structure.

[in] dwCertEncodingType

Specifies the type of encoding 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

[in] pSignerId

A pointer to a CERT_INFO structure containing the issuer and serial number. Can be NULL if there is no content or signer.

[in] hMsgCertStore

A handle to the certificate store containing all the certificates and CRLs in the signed message.

Return value

If a signer certificate is found, the function returns a pointer to a read-only CERT_CONTEXT. The returned CERT_CONTEXT was obtained either from a certificate store or was created using CertCreateCertificateContext. In either case, it must be freed using CertFreeCertificateContext. If this function fails, the return value is NULL.

Remarks

If the message does not contain content or signers, the function is called with pSignerId set to NULL.

Requirements

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