Get CKA_ID of certificate #529
-
|
Hello, I tried to get the public key from the certificate and then use EVP_PKEY_print_public hoping that it will print the URI, but it did not work, the URI was not printed. Thank you! Provider version 1.0 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 13 replies
-
|
Do you have to do this in code, or can you use other utilities? Example: From this uri returned |
Beta Was this translation helpful? Give feedback.
-
|
This needs to be done in code. The thing is that the manufacturer sometimes releases new versions of tokens and the CKA_IDs of the objects change, but the certificate labels remain the same. I know the CKA_IDs of the released versions, but I need a way to read the CKA_IDs for future versions so that I don't have to change the code every time. |
Beta Was this translation helpful? Give feedback.
-
|
You can open a feature request to be able to get CKA_ID gia an EVP_PKEY_get_params() call in the future, not easily available right now. |
Beta Was this translation helpful? Give feedback.
-
|
@dengert the point is, if OpenSC or something else generates CKA_ID out of thin air, this is bad, and should be changed. CKA_UNIQUE_ID can be generated out of thin air, because it is a unique id (per token) and the applicaiton ha sno say on how it is built. CKA_ID has to be preserved and changeable, it is better to fail to change it so the application knows it cannot rely on it then to make one up arbitrarily. As for the french spec the only reason they can get away with it is that CKA_ID is set on pre-generated key, and I think they may be within spec to prevent any modification of objects after creation. I think returning CKA_ID prom pkcs11-provider is valuable, and I see no reason why we would not do it eventually, although I lean towards simply returning a pkcs11 URI rather than individual bits and pieces. It is just not a high priority for now, given users of such cards need to find out only once, generally. Also note that for many operation pkcs#11 internally can find the "Associated" object, and it does that in part via CKA_ID matching. |
Beta Was this translation helpful? Give feedback.
You can open a feature request to be able to get CKA_ID gia an EVP_PKEY_get_params() call in the future, not easily available right now.