Topic
  • 1 reply
  • Latest Post - ‏2013-04-20T08:22:28Z by JPdev
SystemAdmin
SystemAdmin
2262 Posts

Pinned topic com.ibm.pkcs11.PKCS11Exception: Template is inconsistent

‏2013-04-05T13:29:17Z |
Is this error caused by unsupported device type?
I've tried with config file too, but error was the same.
How can I find out proper config parameters...?

Smart card reader device: ACR38U-I1

code:
com.ibm.crypto.pkcs11impl.provider.IBMPKCS11Impl pkcs11Provider = new com.ibm.crypto.pkcs11impl.provider.IBMPKCS11Impl("C:\\smcard.cfg");
pkcs11Provider.Init("c:\\windows\\system32\\cryptoCertum3PKCS.dll", pin);
Security.addProvider(pkcs11Provider);
KeyStore ks= KeyStore.getInstance("PKCS11IMPLKS", pkcs11Provider);
ks.load(null, null); <-- ERROR

stack trace:
com.ibm.pkcs11.PKCS11Exception: Template is inconsistent
at com.ibm.pkcs11.nat.NativePKCS11Session.createObject(Native Method)
at com.ibm.crypto.pkcs11impl.provider.Session.createObject(Session.java:110)
at com.ibm.crypto.pkcs11impl.provider.RSAPublicKey.<init>(RSAPublicKey.java:302)
at com.ibm.crypto.pkcs11impl.provider.RSAPKCS11KeyFactory.engineGeneratePublic(RSAPKCS11KeyFactory.java:222)
at java.security.KeyFactory.generatePublic(KeyFactory.java:145)
at com.ibm.security.x509.X509Key.buildX509Key(X509Key.java:278)
at com.ibm.security.x509.X509Key.parse(X509Key.java:189)
at com.ibm.security.x509.CertificateX509Key.<init>(CertificateX509Key.java:132)
at com.ibm.security.x509.X509CertInfo.parse(X509CertInfo.java:964)
at com.ibm.security.x509.X509CertInfo.<init>(X509CertInfo.java:236)
at com.ibm.security.x509.X509CertImpl.parse(X509CertImpl.java:2291)
at com.ibm.security.x509.X509CertImpl.<init>(X509CertImpl.java:268)
at com.ibm.crypto.pkcs11impl.provider.X509Factory.engineGenerateCertificate(X509Factory.java:145)
at java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:409)
at com.ibm.crypto.pkcs11impl.provider.PKCS11KeyStore$PKCS11CertObj.getX509Certificate(PKCS11KeyStore.java:3202)
at com.ibm.crypto.pkcs11impl.provider.PKCS11KeyStore.engineLoad(PKCS11KeyStore.java:3069)
at java.security.KeyStore.load(KeyStore.java:414)
at stx.SCStore.main(SCStore.java:38)
  • JPdev
    JPdev
    18 Posts

    Re: com.ibm.pkcs11.PKCS11Exception: Template is inconsistent

    ‏2013-04-20T08:22:28Z  

    Hi,

    No keystore loaded ? imply no Certificate => imply no public key and more.

    regards