PFN_CRYPT_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC callback function (wincrypt.h)

If a signature contains encoded parameters, the PFN_CRYPT_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC callback function is called to decode and return the hash algorithm identifier and optionally the signature parameters.

Syntax

PFN_CRYPT_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC PfnCryptExtractEncodedSignatureParametersFunc;

BOOL PfnCryptExtractEncodedSignatureParametersFunc(
  [in]            DWORD dwCertEncodingType,
  [in]            PCRYPT_ALGORITHM_IDENTIFIER pSignatureAlgorithm,
  [out, optional] void **ppvDecodedSignPara,
  [out]           LPWSTR *ppwszCNGHashAlgid
)
{...}

Parameters

[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] pSignatureAlgorithm

A pointer to a CRYPT_ALGORITHM_IDENTIFIER structure that contains the signature object identifier (OID) and its optional encoded parameters.

[out, optional] ppvDecodedSignPara

A pointer to an address for the decoded and allocated signature parameters data structure. Returning the decoded buffer is optional.

[out] ppwszCNGHashAlgid

A pointer to an address for the allocated Unicode string that represents the CNG hash algorithm identifier extracted from the encoded signature parameters. If this function returns TRUE, a non-NULL pointer must be returned.

Return value

If the function succeeds, the function returns nonzero (TRUE).

If the function fails, it returns zero (FALSE). For extended error information, call GetLastError.

If this callback function does not support the signature algorithm, it must return FALSE and call SetLastError with ERROR_NOT_SUPPORTED.

Remarks

Memory for the ppvDecodedSignPara and ppwszCNGHashAlgid parameters must be allocated by using the LocalAlloc function.

You can use OID Support Functions to deploy this callback function. Wincrypt.h defines the following constant for this purpose.

Constant Definition
CRYPT_OID_EXTRACT_ENCODED_SIGNATURE_PARAMETERS_FUNC "CryptDllExtractEncodedSignatureParameters"

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header wincrypt.h