Hei, The question is not Ncryptoki, but I didn’t know anywhere else to ask .. so if anyone can help, please help me. Im tryng to generate an AES key and has the code that I have right now:
CK_MECHANISM keyGenMech = new CK_MECHANISM(CKM.AES_KEY_GEN); CK_ATTRIBUTE[] template = { new CK_ATTRIBUTE(CKA.CLASS, CKO.SECRET_KEY), new CK_ATTRIBUTE(CKA.TOKEN, CK_BBOOL.TRUE), new CK_ATTRIBUTE(CKA.SENSITIVE, CK_BBOOL.TRUE), new CK_ATTRIBUTE(CKA.VALUE_LEN, 32), new CK_ATTRIBUTE(CKA.KEY_TYPE, CKK.AES), new CK_ATTRIBUTE(CKA.LABEL, "testAES".getBytes()), new CK_ATTRIBUTE(CKA.PRIVATE, new CK_BBOOL(bPrivate)) }; CryptokiEx.C_GenerateKey(session, keyGenMech, template, template.length, wrappingKey);
But this gives me an error:
C_GenerateKey rv=0x62 - key size range
Can someone give me some idea where to go from here to solve this problem.
EDIT: For information only - I have SafeNet HSM and im using the PKCS # 11 java shell called jprov that comes with SafeNet ProtectToolkit.
t678
source share