Skip to content
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 generate key with Attribute.SENSITIVE False #127

Open
maynardflies opened this issue Aug 13, 2021 · 1 comment
Open

Unable to generate key with Attribute.SENSITIVE False #127

maynardflies opened this issue Aug 13, 2021 · 1 comment

Comments

@maynardflies
Copy link

maynardflies commented Aug 13, 2021

I am following the documentation to generate an exportable AES key, but when I use the below code snippet, I get the subsequent error stack.

I am using a Luna password-based HSM but am not sure of the version. Any help would be appreciated!

from pkcs11 import KeyType, Attribute

key = session.generate_key(KeyType.AES, 256, template={
    Attribute.SENSITIVE: False,
    Attribute.EXTRACTABLE: True,
})
print(key[Attribute.VALUE])

Traceback (most recent call last):
  File "create_key.py", line 33, in <module>
    key = session.generate_key(pkcs11.KeyType.AES, 256, store=False, label=args.keylabel, template={
  File "pkcs11/_pkcs11.pyx", line 488, in pkcs11._pkcs11.Session.generate_key
  File "pkcs11/_errors.pyx", line 88, in pkcs11._pkcs11.assertRV
pkcs11.exceptions.AttributeValueInvalid
@princykv
Copy link

We are also facing same issue, we cannot unwarp a key to get the key value. Cannot set the attribute sensitive as false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants