Add mechanism for serializing private keys #36
-
SummayAdd an MotivationCurrently private keys cannot be serialized. This is generally a good thing as it avoids misuse, however there are cases where it is a limitation. The one I encountered was the serialization of the result of a Diffie-Hellman for an OpenPGP card implementation, which requires returning the output of a Diffie-Hellman to the host. It would we useful to have a general mechanism to allow serialization of private keys, which is off by default. DrawbacksThis is a breaking API change for Inspirations
Unresolved questionsWhat to do with a "secret" public key? If the default for AlternativesAdd an
|
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 9 replies
-
Edited to add "Unresolved questions". |
Beta Was this translation helpful? Give feedback.
-
Ok, I've begun working on an implementation. I think it's better to call it "extractable" instead of "secrecy". The issue I'm encounter is for the serialization of asymmetric keys. The "Secrecy" (public or private) modifies the path of the key, so the client can't try to load the key and then look at whether it's a public or a private key. This seems redundant with the |
Beta Was this translation helpful? Give feedback.
-
Draft implementation is at #39 |
Beta Was this translation helpful? Give feedback.
-
Thanks for looking into this. Web Crypto as inspiration is good :) Two things that are important:
For symm, I think serializing as raw bytes makes the most sense? For the wrapping key, if it's for another hw key, ideally we can use the agreement identity key of that device (together with its certificate). |
Beta Was this translation helpful? Give feedback.
-
I has but only for management operations, not for cryptographic operation. I wouldn't make much sense for standard use anyway since the keys is plugged directly into the host it's communicating with. |
Beta Was this translation helpful? Give feedback.
-
The Other types of privates keys will not be exportable. |
Beta Was this translation helpful? Give feedback.
The
SharedSecret
case was fixed by #39Other types of privates keys will not be exportable.