Pkcs11Interop / Pkcs11Interop.X509Store

Easy to use PKCS#11 based X.509 certificate store
Apache License 2.0
32 stars 18 forks source link

FindKey includes label #26

Closed DadOfTheDead closed 2 years ago

DadOfTheDead commented 2 years ago

Hi, on my card private key and public key of the certificate are not found. I dug into it and found that your search for keys in FindKeys in Pkcs11X509Certificate includes CKA_ID and also CKA_Label. On my card however Label is only set on the certificate - not on either of the keys - when importing the certificate using the provider tool (Thales SafeNet). Do you think it is a good idea to exclude label search not only for me but everyone? BR and thanks for your work.

Edit: Tested with another type of card (ACOS). When putting a certificate on that card label is not set for either certificate, private key or public key. All empty.

jariq commented 2 years ago

Yes, excluding CKA_LABEL from search template sounds like a good idea. I'll remove it in next version.

DadOfTheDead commented 2 years ago

Thanks

dalmohub commented 2 years ago

Hi. I have the same problem. I.E. it's unable to find my token's private key if CKA.CKA_LABEL is included in the search. https://stackoverflow.com/questions/70003640/pkcs11interop-x509store-unable-to-find-private-key Would you consider a PR excluding CKA_LABEL from the search? Thanks in advance.

jariq commented 2 years ago

This feature will be published today in Pkcs11Interop.X509Store 0.4.0.