PFN_AUTHENTICODE_DIGEST_SIGN callback function

The PFN_AUTHENTICODE_DIGEST_SIGN user supplied callback function implements digest signing. You must implement this function as part of your provided dll. This function is currently called by SignerSignEx3 for digest signing.

Syntax

PFN_AUTHENTICODE_DIGEST_SIGN pfnAuthenticodeDigestSign; 

HRESULT __stdcall pfnAuthenticodeDigestSign(
    _In_ PCCERT_CONTEXT pSigningCert,                        
    _In_opt_ PCRYPT_DATA_BLOB pMetadataBlob,                 
    _In_ ALG_ID digestAlgId,                                 
    _In_ PBYTE pbToBeSignedDigest, 
    _In_ DWORD cbToBeSignedDigest,                           
    _Out_ PCRYPT_DATA_BLOB pSignedDigest                     
);

Parameters

pSigningCert [in]

A pointer to a CERT_CONTEXT structure that specifies the certificate used to create the digital signature.

pMetadataBlob [in, optional]

Pointer to a CRYPT_DATA_BLOB structure that contains metadata for digest signing.

digestAlgId [in]

Specifies the digest algorithm to be used for digest signing.

pbToBeSignedDigest [in]

Pointer to a buffer which contains the digest to be signed.

cbToBeSignedDigest [in]

The size, in bytes, of the pbToBeSignedDigest buffer.

pSignedDigest [out]

Pointer to CRYPT_DATA_BLOB which receives the signed digest.

Return value

If the function succeeds, the function returns S_OK. If the function fails, it returns an HRESULT value that indicates the error. For a list of common error codes, see Common HRESULT Values.

Remarks

The parameter pSignedDigest->pbData must be allocated by calling HeapAlloc passing the result of GetProcessHeap() as the first parameter.

Requirements

Requirement Value
Minimum supported client
Windows 10 [desktop apps only]
Minimum supported server
Windows Server 2016 [desktop apps only]
DLL
Mssign32.dll