AnsweredAssumed Answered

When I try to initialize a KeyStore object, I get an exception CKR_ATTRIBUTE_TYPE_INVALID.  I create a CallBackHandler object in Java, and then call cardKeystoreBuilder.getKeyStore().  I am using a CAC card.  I get prompted to enter my PIN, and then get t

Question asked by aAzMAgeLaVqMF4abWgKKimUEg7bqto04AvBzs8Sx8qE= on Feb 16, 2016
Latest reply on Feb 16, 2016 by aAzMAgeLaVqMF4abWgKKimUEg7bqto04AvBzs8Sx8qE=

Here is my sample code:

 

File acpkcs64bit = new File("C:\\Progra~2\\ActivIdentity\\ActivClient\\acpkcs211.dll");

File pkcsProperties = new File("C:\\TestDir\\pkcs11.properties");

 

Security.addProvider(new sun.security.pkcs11.SunPKCS11(pkcsProperties.getPath()));

 

CallbackHandler cardCallbackHandler = new CallbackHandler() {

     public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {} };

 

cardKeystoreBuilder = KeyStore.Builder.newInstance("PKCS11", null, new KeyStore.CallbackHandlerProtection(cardCallbackHandler());

 

KeyStore keyStore = cardKeystoreBuilder.getKeyStore();

 

When the code tries to initialize the KeyStore object, I get the exception CKR_ATTRIBUTE_TYPE_INVALID.

 

I do have ActivClient installed on my machine.

 

The contents of my pkcs11.properties file are as follows:

 

name=ActivClient

library = C:\Program~2\ActivIdentity\ActivClient\acpkcs211.dll

 

I apologize if I posted this in the wrong location.  I'd appreciate any help you can give me.

Outcomes