[opencryptoki-users] Opencryptoki and Java JCA
Brought to you by:
ebarretto
From: Gideon K. <gid...@go...> - 2012-06-25 13:30:52
|
Hi, I'm trying to use the Sun PKCS#11 provider to manage my TPM token. I can use stored symmetric keys within a Java program but I'm not able to store an AES key in the token. In fact I can store the key but I am not able to read the stored key. The same problem occurs when I use keytool to generate and store a secret key. This is the error which occurs when I try to read the secret key: Exception in thread "main" java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_ATTRIBUTE_TYPE_INVALID at sun.security.pkcs11.P11KeyStore.engineGetKey(P11KeyStore.java:335) at java.security.KeyStore.getKey(KeyStore.java:792) at Java4.main(Java4.java:16) 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.P11KeyStore.loadSkey(P11KeyStore.java:1306) at sun.security.pkcs11.P11KeyStore.engineGetKey(P11KeyStore.java:328) ... 2 more I haven't specified any additional Attibutes. The problem does not occur if the key is generated with "tpmtoken_protect". The used software is Java 1.7 and Opencryptoki 2.4.2 Thanks! |