p11-glue / p11-kit

Provides a way to load and enumerate PKCS#11 modules.
https://p11-glue.github.io/p11-glue/p11-kit.html
Other
151 stars 94 forks source link

export-object: Recover public key from algorithm specific attributes #568

Closed ueno closed 1 year ago

ueno commented 1 year ago

Some tokens such as SoftHSMv2 omit CKA_PUBLIC_KEY_INFO when it can be derived from algorithm specific attributes, such as CKA_MODULUS and CKA_PUBLIC_EXPONENT for RSA. This adds support for it if libtasn1 is available at compile time.

Fixes: #555

coveralls commented 1 year ago

Coverage Status

coverage: 68.851% (-0.03%) from 68.882% when pulling 652c115bcb9fe983609e4814b124678c52a30d5a on ueno:wip/dueno/pubkey into e8872bfdc4b12735bbc0433a59fc0a7ddfd68bbb on p11-glue:master.

ZoltanFridrich commented 1 year ago

I have tested the command manually together with valgrind. Seems to work fine.