Partager via


CryptHashCertificate2 (Compact 2013)

3/28/2014

This function hashes a block of data by using a Cryptography API: Next Generation (CNG) hash provider.

Syntax

BOOL WINAPI CryptHashCertificate2(
     __in LPCWSTR pwszCNGHashAlgid,
     __in DWORD dwFlags,
     __reserved void* pvReserved,
     __in BYTE* pbEncoded,
     __in DWORD cbEncoded,
      __out BYTE* pbComputedHash,
      __inout DWORD* pcbComputedHash
);

Parameters

  • pwszCNGHashAlgid
    [in] Address of a null-terminated Unicode string that contains the CNG hash algorithm identifier of the hash algorithm to use to hash the certificate. This identifier can be one of the CNG Algorithm Identifiers that represents a hash algorithm or any other registered hash algorithm identifier.
  • dwFlags
    [in] Set of flags that modify the behavior of this function. No flags are defined for this function.
  • pvReserved
    [in] Reserved; set to NULL.
  • pbEncoded
    [in] Address of an array of bytes to be hashed. The cbEncoded parameter contains the size of this array.
  • cbEncoded
    [in] Number of elements in the pbEncoded array.
  • pbComputedHash
    [out] Address of a buffer that receives the computed hash. The variable pointed to by the pcbComputedHash parameter contains the size of this buffer.
  • pcbComputedHash
    [in, out] Address of a DWORD variable that, on entry, contains the size, in bytes, of the pbComputedHash buffer. After this function returns, this variable contains the number of bytes copied to the pbComputedHash buffer.

Return Value

Returns true (nonzero) if the function succeeds and a new store is added to the collection of stores.

Returns false (zero) if the function fails and a new store is not added.

To retrieve extended error information, call GetLastError.

Requirements

Header

wincrypt.h

Library

crypt32.lib

See Also

Reference

Certificates Functions