[英]PKCS11Exception ckr_attribute_type_invalid
I am trying to create a keystore to get a private key with a smart card 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());
But it gives me this exception: 但它给了我这个例外:
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
This code was working until yesterday. 这段代码一直工作到昨天。 I could not figure out the problem.
我无法弄清楚这个问题。 If you can help me I would really appreciate it.
如果你能帮助我,我会非常感激。
I have worked it out. 我已经解决了。 One of the 3 keys which does not have any ID was extra.
没有任何ID的3个键中的一个是额外的。 I contacted the card company and we removed the extra key.
我联系了卡公司,我们删除了额外的密钥。 Now it loads without a problem.
现在加载没有问题。 Thanks for your help.
谢谢你的帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.