Pkcs11Interop CKR_ENCRYPTED_DATA_INVALID exception cause high CPU usage

时间:2017-07-12 07:58:40

标签: c# pkcs#11 hsm pkcs11interop

We are using Pkcs11Interop library for cryptography and we customize&implement Pkcs11Interop code samples for our project where Pkcs11Interop documents in Github. In production, not everyday but we have to restart server after CPU usage reach maximum when we get a consecutive(4 or 5 times) CKR_ENCRYPTED_DATA_INVALID exception. What cause this ? How can we fix this problem ? Any ideas will be appreciated. If anyone want I can share our code sample. Thanks for helping.

2017-07-11 10:45:07,580 ERROR HSM | 11.07.2017 10:45:07 | HSM Decrypt error occured Net.Pkcs11Interop.Common.Pkcs11Exception: Method C_Decrypt returned CKR_ENCRYPTED_DATA_INVALID at Net.Pkcs11Interop.HighLevelAPI41.Session.Decrypt(Mechanism mechanism, ObjectHandle keyHandle, Byte[] encryptedData) at Pkcs11HsmHost.DecryptInSession(Session session, String value, Int32 keyIndex, Int32 retryCount) in Security\Pkcs11HsmHost.cs:line 164

1 个答案:

答案 0 :(得分:0)

您很可能在miltithreaded环境中没有正确使用PKCS#11库。有关详细信息,请参阅this answer