You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would appreciate a little guidance on the smart/correct way to get an object pointing to a previously generated key. The documentation shows how to generate or import a key and how to perform operations with keys, but not how to point to already existing keys. (I won't use the term "load" here or such as I do want the keys to remain inside the HSM when the crypto operation is done)
For a symmetric key, the label seems sufficient for specifying which key we want to use: symmetricKey = session.get_key(label='symmetric')
but the generate_keypair() used for asymmetric key types leads to both public and private key having the same label so the best I have come up with so far is: privateAsymmetricKey = session.get_key(label='asymmetric', object_class=pkcs11.ObjectClass.PRIVATE_KEY) publicAsymmetricKey = session.get_key(label='asymmetric', object_class=pkcs11.ObjectClass.PUBLIC_KEY)
Apologies in advance if this is already documented somewhere I've failed to look (or read and failed to understand)
The text was updated successfully, but these errors were encountered:
I would appreciate a little guidance on the smart/correct way to get an object pointing to a previously generated key. The documentation shows how to generate or import a key and how to perform operations with keys, but not how to point to already existing keys. (I won't use the term "load" here or such as I do want the keys to remain inside the HSM when the crypto operation is done)
For a symmetric key, the label seems sufficient for specifying which key we want to use:
symmetricKey = session.get_key(label='symmetric')
but the generate_keypair() used for asymmetric key types leads to both public and private key having the same label so the best I have come up with so far is:
privateAsymmetricKey = session.get_key(label='asymmetric', object_class=pkcs11.ObjectClass.PRIVATE_KEY)
publicAsymmetricKey = session.get_key(label='asymmetric', object_class=pkcs11.ObjectClass.PUBLIC_KEY)
Apologies in advance if this is already documented somewhere I've failed to look (or read and failed to understand)
The text was updated successfully, but these errors were encountered: