-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to import an asymmetric wrapping key? #371
Comments
Hi @mouse07410 I see few issues here: 1- It looks like you are trying to import an asymmetric key and use it as a wrap key. This is not supported by the YubiHSM2. Wrapkeys are separate objects with symmetric properties. Asymmetric keys can only be used for signing, decryption and derivation of ECDH keys. 2- The command have 2 issues that I can immediately see: I hope this helps |
@aveenismail thank you! Yes it helps, but here are some questions:
How can I get "wrapkey" functionality - securely export an object, such as symmetric key or asymmetric key-pair, from the HSM, and (securely) import it into a different device (another HSM, or TPM, or such)?
Does it mean there's no way to import a public key into HSM, and one would have to perform all the operations with it in software (on the host)? I'm trying to find a way to accomplish "wrapping" with asymmetric, as described above. |
1- Use the Export Wrapped command to export objects under wrap (https://developers.yubico.com/YubiHSM2/Commands/Export_Wrapped.html). Then use the Import Wrapped command to import the wrapped object into the other YubiHSM (https://developers.yubico.com/YubiHSM2/Commands/Import_Wrapped.html) 2- |
I want to exchange wrapped objects between YubiHSM2 and a non-Yubico device(s) such as TPM. My preference is to keep the "unencrypted" objects only inside those hardware modules - which makes exporting an unencrypted key (even if HSM would allow it, which I doubt) and encrypting it on the host in software - undesirable. I guess, for that I'll need the exact format of the wrapped structure... Re. asummetric wrap - please pass it to the leadership as a feature request. |
You are correct in that private keys cannot be exported from the YubiHSM unless they are wrapped. While Yubico does not provide a softwrare to unwrap a wrapped objects outside a YubiHSM, the yubihsm-wrap tool (part of this repository) does provide a way to wrap objects outside of a YubiHSM so they can be unwraped inside one. Maybe that can be a helpful reference. Asymmetric wrap feature request has been forwarded to the product team. |
Thank you - but I also need the reverse: wrap within the YubiHSM, and unwrap inside a TMP or another hardware module (not YubiHSM).
Thank you! |
Two YubiHSM2 devices with firmware 2.0.0 and 2.2.0. Latest
yubihsm-shell
master.Goal:
k1.pem
);tpmwrap
) into HSM2;tpmwrap
key;Step 1 succeeds (obviously) - generating the key and outputting
k1.pem
works.Step 2 fails with
Unable to read asymmetric key
.OpenSSL-3.1.4 believes the key is OK:
Here's my command, and what YubiHSM2 tells me:
Documentation did not help much.
Please help.
The text was updated successfully, but these errors were encountered: