PKCS11Exception ckr_attribute_type_invalid

PKCS11Exception ckr_attribute_type_invalid

我正在尝试创建密钥库以使用智能卡获取私钥 reader。

String config = "name = AKIS\nlibrary = C:/Windows/System32/akisp11.dll";
Security.addProvider(akisProvider);
KeyStore ks = KeyStore.getInstance("PKCS11", akisProvider);
ks.load(null, "000000".toCharArray());

但它给了我这个例外:

java.io.IOException: load failed
    at sun.security.pkcs11.P11KeyStore.engineLoad(P11KeyStore.java:763)
    at java.security.KeyStore.load(KeyStore.java:1445)
    at deneme.AkisImzaImpl.dene(AkisImzaImpl.java:55)
    at deneme.Deneme.main(Deneme.java:83)
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_TYPE_INVALID
    at sun.security.pkcs11.wrapper.PKCS11.C_GetAttributeValue(Native Method)
    at sun.security.pkcs11.wrapper.PKCS11$SynchronizedPKCS11.C_GetAttributeValue(PKCS11.java:1623)
    at sun.security.pkcs11.P11KeyStore.mapLabels(P11KeyStore.java:2277)
    at sun.security.pkcs11.P11KeyStore.engineLoad(P11KeyStore.java:755)
    ... 3 more

这段代码在昨天之前一直有效。我无法弄清楚问题所在。如果你能帮助我,我将不胜感激。

我已经解决了。没有任何 ID 的 3 把钥匙之一是额外的。我联系了信用卡公司,我们移除了多余的钥匙。现在它加载没有问题。感谢您的帮助。