calcKvcMech

Calculate and return an AS2805 KVC for a key.  The key must be capable of doing an encryption operation using the supplied mechanism for this to succeed. Note that mechanism parameters are set to NULL.

NOTE   The CKA_CHECK_VALUE attribute can be used to get the KVC of a key that does not support the encryption operation.

Synopsis

CK_RV calcKvcMech(
CK_SESSION_HANDLE hSession,
CK_OBJECT_HANDLE hKey,
CK_MECHANISM_TYPE mt,
unsigned char * kvc,
int kvclen,
int * pkvclen);
Parameter Description
hSession Open session handle
hKey Handle to the key to use for the encryption
mt Encryption mechanism to use
kvc Buffer to hold the encryption result
kvclen Total number of bytes referenced by kvc
pkvclen Reference to int to hold number of bytes copied into kvc

On successful return

kvc — holds the encryption result

*pkvclen — number of bytes copied into kvc

If kvclen is smaller than the encryption result, then only kvclen bytes are copied into kvc.