<div dir="ltr"><div dir="ltr">I am trying to retrieve the key bytes of a wrapped key. We are using IAIK with SoftHSM 2.4.0.</div><div dir="ltr"><br></div><div dir="ltr">When I unwrap the key, the key object returned but when we get the key bytes, I get null.<br><br>Key template has been initialized with “sensitive=false” and below code works find with the Thales HSM appliance, but not with SoftHSM.<br><br>    long CKM_AES_KEY_WRAP = 0x00002109L;<br>         Mechanism wrappingMechanism = new Mechanism(CKM_AES_KEY_WRAP);<br>        InitializationVectorParameters ivParam = new InitializationVectorParameters(iv);<br>        wrappingMechanism.setParameters(ivParam);<br>        AESSecretKey key = session.unwrapKey(wrappingMechanism, keyEncryptionKey, wrappedKey, keyTemplate);<br>    byte[] plaintextkey = key.getValue().getByteArrayValue();<br>     <br></div><div>Error I'm getting:<br></div><div dir="ltr"> (plaintextkey is null)<br><br>Any ideas or workaround to get this to work?  Any input is much appreciated.<br></div></div>