Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CryptHashCertificate2 function

The CryptHashCertificate2 function hashes a block of data by using a 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]

The 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 can be one of the CNG Algorithm Identifiers that represents a hash algorithm or any other registered hash algorithm identifier.

dwFlags [in]

A set of flags that modify the behavior of this function. No flags are defined for this function.

pvReserved

Reserved for future use and must be NULL.

pbEncoded [in]

The address of an array of bytes to be hashed. The cbEncoded parameter contains the size of this array.

cbEncoded [in]

The number of elements in the pbEncoded array.

pbComputedHash [out]

The 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]

The 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

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

If the function fails, it returns zero (FALSE). For extended error information, call GetLastError. Some of the possible error codes are identified in the following topics.

BCryptOpenAlgorithmProvider
BCryptCreateHash
BCryptGetProperty
BCryptHashData
BCryptFinishHash

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Wincrypt.h

Library

Crypt32.lib

DLL

Crypt32.dll

See also

Data Management Functions

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.