CryptXmlDllSignData callback function (cryptxml.h)

The CryptXmlDllSignData function signs data.

The CryptXmlDllSignData function is exposed through the exported CryptXmlDllGetInterface function.

Syntax

CryptXmlDllSignData Cryptxmldllsigndata;

HRESULT Cryptxmldllsigndata(
  [in]            const CRYPT_XML_ALGORITHM *pSignatureMethod,
  [in]            HCRYPTPROV_OR_NCRYPT_KEY_HANDLE hCryptProvOrNCryptKey,
  [in]            DWORD dwKeySpec,
  [in]            const BYTE *pbInput,
  [in]            ULONG cbInput,
  [out, optional] BYTE *pbOutput,
  [in]            ULONG cbOutput,
  [out]           ULONG *pcbResult
)
{...}

Parameters

[in] pSignatureMethod

A pointer to a CRYPT_XML_ALGORITHM structure that specifies the algorithm.

[in] hCryptProvOrNCryptKey

The handle of the cryptographic service provider (CSP) that creates the signature. This handle must be an HCRYPTPROV handle that was obtained from a call to the CryptAcquireContext function or an NCRYPT_KEY_HANDLE handle that was created by using the NCryptOpenKey function. New applications should pass in an NCRYPT_KEY_HANDLE handle.

[in] dwKeySpec

The private key to use from the provider's container. This key can be AT_KEYEXCHANGE or AT_SIGNATURE. This parameter is ignored if an NCRYPT_KEY_HANDLE handle is used in the hCryptProvOrNCryptKey parameter.

[in] pbInput

A pointer to a buffer that contains the digest value to sign. The cbInput parameter contains the size of this buffer.

[in] cbInput

The size, in bytes, of the buffer pointed to by the pbInput parameter.

[out, optional] pbOutput

The address of a buffer to receive the signature produced by this function. The cbOutput parameter contains the size of this buffer.

If this parameter is NULL, this function will calculate the size needed for the encrypted data and return the size in the location pointed to by the pcbResult parameter.

[in] cbOutput

The size, in bytes, of the buffer pointed to by the pbOutput parameter.

[out] pcbResult

A pointer to a DWORD variable that receives the number of bytes copied to the pbOutput buffer. If pbOutput is NULL, this receives the size, in bytes, required for the signature.

Return value

If the function succeeds, the function returns zero.

If the function fails, it returns an HRESULT value that indicates the error.

Requirements

Requirement Value
Minimum supported client Windows 7 [desktop apps only]
Minimum supported server Windows Server 2008 R2 [desktop apps only]
Target Platform Windows
Header cryptxml.h