Re: [opencryptoki-users] Opencryptoki and Java JCA
Brought to you by:
ebarretto
From: Joy L. <la...@us...> - 2012-06-26 21:27:29
|
Let me make sure I understand. Are you trying to store an externally generated AES key ? If so, how are you creating the pkcs#11 secret key object? regards, Joy Gideon Knocke <gid...@go...> wrote on 06/25/2012 08:30:40 AM: > Gideon Knocke <gid...@go...> > 06/25/2012 08:30 AM > > To > > ope...@li..., > > cc > > Subject > > [opencryptoki-users] Opencryptoki and Java JCA > > 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! > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > opencryptoki-users mailing list > ope...@li... > https://lists.sourceforge.net/lists/listinfo/opencryptoki-users > |