Decrypt Function returns successful but decrpyted value contain garbage

2/8/2018 8:54:42 AM
Gravatar
Total Posts 5

Decrypt Function returns successful but decrpyted value contain garbage

Help

CK_RV C_Decrypt(CK_SESSION_HANDLE hSession, CK_BYTE_PTR pEncryptedData, CK_ULONG ulEncryptedDataLen, CK_BYTE_PTR pData, CK_ULONG_PTR pulDataLen);

My call to the C_Decrypt method is successful in the sense that it returns 0 - CKR_OK

However when I look at the dereferenced value returned from pdata it contains garbage

How can this be? What am I doing wrong. The function is successful but the uneccrypted value wrong

The pulDataLength (length of the decypted text) is correct

Thanks
Mark