在我的工作中,我需要使用来自SmartCard的certfifcate签署XML文件。一切正常,但在32位Windows 7 VM上。当我尝试在64位Windows 10上使用相同的代码时出现问题。我收到“未找到PKCS#11”和“没有这样的算法”的错误。我用的是xades4j包。我已经尝试过在网上找到的所有解决方案,即
在32位和64位版本中使用了不同的.dll库(pkcs11.dll,opensc-spy.dll,CPPkiP.dll,esp2003csp11.dll)。
在System32和SysWOW64目录中放置.dll。
更新了我的阅读器驱动程序(IDBridge CT30)。
将jre更改为32位。
PKCS11参考指南(不带xades4j)中使用的解决方案 - 它也仅适用于32位。
什么都没有帮助,总是会发生相同的异常。如果有人有任何想法我还能做些什么,我会非常感谢你提示。
最好的祝福。
Caused by: java.security.KeyStoreException: PKCS11 not found
at java.security.KeyStore.getInstance(Unknown Source)
at java.security.KeyStore$Builder$2$1.run(Unknown Source)
at java.security.KeyStore$Builder$2$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Caused by: java.security.NoSuchAlgorithmException: no such algorithm: PKCS11 for provider SunPKCS11-SmartCard
at sun.security.jca.GetInstance.getService(Unknown Source)
at sun.security.jca.GetInstance.getInstance(Unknown Source)
at java.security.Security.getImpl(Unknown Source)
... 11 more