Edit

PFN_AUTHENTICODE_DIGEST_SIGN_EX callback function

The PFN_AUTHENTICODE_DIGEST_SIGN_EX 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_EX pfnAuthenticodeDigestSignEx;

HRESULT __stdcall pfnAuthenticodeDigestSignEx(
    _In_opt_ PCRYPT_DATA_BLOB pMetadataBlob,         
    _In_ ALG_ID digestAlgId,                                 
    _In_ PBYTE pbToBeSignedDigest, 
    _In_ DWORD cbToBeSignedDigest,                           
    _Out_ PCRYPT_DATA_BLOB pSignedDigest,                    
    _Out_ PCCERT_CONTEXT* ppSignerCert,                      
    _Inout_ HCERTSTORE hCertChainStore                       
);


Parameters

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.

ppSignerCert [out]

Pointer to PCCERT_CONTEXT* which receives the certificate chain signing certificate.

hCertChainStore [in, out, optional]

Optional, receives the cert chain of the signer cert.

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. The parameter *ppSignerCert will be freed by the caller by calling CertFreeCertificateContext.

Requirements

Requirement Value
Minimum supported client
Windows 10 May 2020 Update[desktop apps only]
Minimum supported server
Windows Server 2022 [desktop apps only]
DLL
Mssign32.dll