-
Type:
Bug
-
Status: Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: OpenDNSSEC 1.4.10
-
Fix Version/s: None
-
Component/s: PKCS#11 Interface
-
Labels:None
-
Environment:
MacOS - High Sierra version 10.13.6
Softhsm: 2.4.0
I am trying to retrieve the key bytes of a wrapped key. We are using IAIK with SoftHSM 2.4.0.
When I unwrap the key, the key object returned but when we get the key bytes, I get null.
Key template has been initialized with "sensitive=false" and below code works find with the Thales HSM appliance, but not with SoftHSM.
long CKM_AES_KEY_WRAP = 0x00002109L;
Mechanism wrappingMechanism = new Mechanism(CKM_AES_KEY_WRAP);
InitializationVectorParameters ivParam = new InitializationVectorParameters(iv);
wrappingMechanism.setParameters(ivParam);
AESSecretKey key = session.unwrapKey(wrappingMechanism, keyEncryptionKey, wrappedKey, keyTemplate);
byte[] plaintextkey = key.getValue().getByteArrayValue();
Error I'm getting:
(plaintextkey is null)
Any ideas or workaround to get this to work? Any input is much appreciated.