简体   繁体   English

我的机器睡觉后无法通过Java应用程序与智能卡签名:获取PKCS11Exception:CKR_GENERAL_ERROR

[英]Unable to sign with Smartcard through Java app after my machine has has slept: getting a PKCS11Exception: CKR_GENERAL_ERROR

I have an application that performs digital signatures with a smartcard. 我有一个使用智能卡执行数字签名的应用程序。 If my system sleeps and later wakes (both windows and mac), my invocations to signature.sign start blowing up with a sun.security.pkcs11.wrapper.PKCS11Exception: CKR_GENERAL_ERROR ProviderException from then on 如果我的系统进入睡眠状态,然后又醒来(包括Windows和Mac),那么我对signature.sign调用就会开始发生sun.security.pkcs11.wrapper.PKCS11Exception: CKR_GENERAL_ERROR ProviderException

Do you have any idea of how should I get my program to sign again without this pesky error? 您是否知道如何让我的程序再次签名而又没有此讨厌的错误?

I have noticed that it is possible to recover from this error by removing the card from the card reader, attempting to sign again without having any card in the cardreader (thus intentionally failing) and later putting the card in the cardreader and try to sign again. 我注意到,可以通过以下方式从此错误中恢复:从读卡器中取出卡,尝试再次签名而不在读卡器中插入任何卡(因此有意失败),然后将卡放入读卡器中,然后再次尝试签名。

As this behaviour depends on removing the card, the way I am handling the error is by requesting the user to take out and put in the card at certain moments. 由于此行为取决于取出卡,因此我处理错误的方法是要求用户在特定时刻取出并放入卡。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM