I am trying to export and then import a Key from and into a YubiHSM2 device. I am using the Yubishell for the moment.
* Here we create a key to be wrapped
generate asymmetric 0 0 my_ecckey 1 sign-ecdsa:exportable-under-wrap ecp256
* Now, the wrapping key
generate wrapkey 0 0 wrapkey 1 export-wrapped:import-wrapped sign-ecdsa:exportable-under-wrap aes256-ccm-wrap
* And then, we wrap my_ecckey
get wrapped 0 [wrap_key_ID] asymmetric-key [Key_ID] my_eddkey.wrapped
Everything's fine until now. I then try to delete the key and re-import it.
delete 0 [Key_ID] asymmetric-key
put wrapped 0 [wrap_key_ID] my_eddkey.wrapped
Instead of importing the object, I get an error (Failed to store wrapped object: Malformed command / invalid data). I've checked the example in the documentation, and cannot figure-out what am I doing wrong.
Vincent.