Open kshinn opened 9 months ago
On further inspection it could be that I'm misunderstanding the use of the methods on this class. With the provided fix, I can successfully export the key, however it exports it in pkcs8
format. There doesn't seem to be a symmetrical way to import this key material. The import function uses the jwk format instead of a raw format. In order to make this change useful, we would need to also add an importFromRaw
type of method to this class. This may start to diverge from the original intent of these classes. Happy to add if it makes sense.
Context
I'm trying to use the
EcdsaKeyPair
as a utility to generate a stable keypair. For testing purposes I'm:exportable = true
This works fine using the
EdKeypair
, but fails with "key is not extractable" when using the p256 plugin.I believe the problem is that, when creating a new key, the static method does not allow you to specify
exportable
and hardcodes the extraction parameter to "false" when creating the key.I have a PR that addresses this issue that I will reference here.