HID® Crescendo® PKCS11
|
#include <pkcs11/v2.40/cryptoki.h>
Functions | |
CK_RV | C_Digest (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pData, CK_ULONG ulDataLen, CK_BYTE_PTR pDigest, CK_ULONG_PTR pulDigestLen) |
Digests data in a single part. | |
CK_RV | C_DigestFinal (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pDigest, CK_ULONG_PTR pulDigestLen) |
Finishes a multiple-part message-digesting operation, returning the message digest. | |
CK_RV | C_DigestInit (CK_SESSION_HANDLE hSession, CK_MECHANISM_PTR pMechanism) |
Initializes a message-digesting operation. | |
CK_RV | C_DigestKey (CK_SESSION_HANDLE hSession, CK_OBJECT_HANDLE hKey) |
Continues a multiple-part message-digesting operation by digesting the value of a secret key. | |
CK_RV | C_DigestUpdate (CK_SESSION_HANDLE hSession, CK_BYTE_PTR pPart, CK_ULONG ulPartLen) |
Continues a multiple-part message-digesting operation, processing another data part. | |
CK_RV C_Digest | ( | CK_SESSION_HANDLE | hSession, |
CK_BYTE_PTR | pData, | ||
CK_ULONG | ulDataLen, | ||
CK_BYTE_PTR | pDigest, | ||
CK_ULONG_PTR | pulDigestLen ) |
Digests data in a single part.
[in] | hSession | is the session's handle. |
[in] | pData | points to the data. |
[in] | ulDataLen | is the length of the data. |
[out] | pDigest | points to the location that receives the message digest. |
[in,out] | pulDigestLen | points to the location that holds the length of the message digest. |
C_Digest uses the convention described in Section 5.2 on producing output.
The digest operation MUST have been initialized with C_DigestInit. A call to C_Digest always terminates the active digest operation unless it returns CKR_BUFFER_TOO_SMALL or is a successful call (i.e., one which returns CKR_OK) to determine the length of the buffer needed to hold the message digest.
C_Digest cannot be used to terminate a multi-part operation, and MUST be called after C_DigestInit without intervening C_DigestUpdate calls.
The input data and digest output can be in the same place, i.e., it is OK if pData
and pDigest
point to the same location.
C_Digest is equivalent to a sequence of C_DigestUpdate operations followed by C_DigestFinal.
CK_RV C_DigestFinal | ( | CK_SESSION_HANDLE | hSession, |
CK_BYTE_PTR | pDigest, | ||
CK_ULONG_PTR | pulDigestLen ) |
Finishes a multiple-part message-digesting operation, returning the message digest.
[in] | hSession | is the session's handle. |
[out] | pDigest | points to the location that receives the message digest. |
[in,out] | pulDigestLen | points to the location that holds the length of the message digest. |
C_DigestFinal uses the convention described in Section 5.2 on producing output.
The digest operation MUST have been initialized with C_DigestInit. A call to C_DigestFinal always terminates the active digest operation unless it returns CKR_BUFFER_TOO_SMALL or is a successful call (i.e., one which returns CKR_OK) to determine the length of the buffer needed to hold the message digest.
CK_RV C_DigestInit | ( | CK_SESSION_HANDLE | hSession, |
CK_MECHANISM_PTR | pMechanism ) |
Initializes a message-digesting operation.
[in] | hSession | is the session's handle. |
[in] | pMechanism | points to the digesting mechanism. |
After calling C_DigestInit, the application can either call C_Digest to digest data in a single part; or call C_DigestUpdate zero or more times, followed by C_DigestFinal, to digest data in multiple parts. The message-digesting operation is active until the application uses a call to C_Digest or C_DigestFinal to actually obtain the message digest. To process additional data (in single or multiple parts), the application MUST call C_DigestInit again.
CK_RV C_DigestKey | ( | CK_SESSION_HANDLE | hSession, |
CK_OBJECT_HANDLE | hKey ) |
Continues a multiple-part message-digesting operation by digesting the value of a secret key.
[in] | hSession | is the session's handle. |
[in] | hKey | is the handle of the secret key to be digested. |
The message-digesting operation MUST have been initialized with C_DigestInit. Calls to this function and C_DigestUpdate may be interspersed any number of times in any order.
If the value of the supplied key cannot be digested purely for some reason related to its length, C_DigestKey should return the error code CKR_KEY_SIZE_RANGE.
CK_RV C_DigestUpdate | ( | CK_SESSION_HANDLE | hSession, |
CK_BYTE_PTR | pPart, | ||
CK_ULONG | ulPartLen ) |
Continues a multiple-part message-digesting operation, processing another data part.
[in] | hSession | is the session's handle. |
[in] | pPart | points to the data part. |
[in] | ulPartLen | is the length of the data part. |
The message-digesting operation MUST have been initialized with C_DigestInit. Calls to this function and C_DigestKey may be interspersed any number of times in any order. A call to C_DigestUpdate which results in an error terminates the current digest operation.