I am attempting to generate an RSA key pair inside a SafeNet HSM. I copied the example templates specified in PKCS11 for the private and public keys. When i generate the key pair everything works fine. However, when i specify for the private key the following attribute values, the C_GenerateKeyPair returns CKR_TEMPLATE_INCONSISTENT:
- CKA_DECRYPT = false.
- CKA_UNWRAP = true.
I can imagine why i get template inconsistent but i just want to verify it. Since the unwrap operation is in it's essence a decrypt operation, then it is not consistent to allow a key to unwrap while it cannot decrypt.
However, shouldn't these two operations be treated separately by PKCS11 implementations?
Thanks in advance.