Embed the private key with public key attributes. #293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After generating a key pair via p11prov_GenerateKeyPair() in p11prov_common_gen(), embed the private key with public key attributes through this new function p11prov_merge_pub_attrs_into_priv().
This would be useful to reconstruct the public key from the private key.
Further, attributes like CKA_P11PROV_PUB_KEY_X and CKA_P11PROV_PUB_KEY_Y can be extracted directly from EC private keys.
The following attributes are copied-
For RSA: CKA_MODULUS, CKA_PUBLIC_EXPONENT
For EC: CKA_EC_POINT, CKA_EC_PARAMS, CKA_P11PROV_PUB_KEY
Fixes #282