implement KeySizeUser for SigningKey and VerifyingKey#733
implement KeySizeUser for SigningKey and VerifyingKey#733carloskiki wants to merge 16 commits intodalek-cryptography:mainfrom
KeySizeUser for SigningKey and VerifyingKey#733Conversation
|
This couples the At the very least this needs a versioning strategy which can tolerate upgrades. |
|
Would gating this behind the Edit: Or we could use |
KeyInit for SigningKeyKeyInit and KeySizeUser for SigningKey and VerifyingKey
|
I believe the work with this PR is done and would be ready for review. |
|
Thank you! I'm confused, though, aren't these traits mostly intended for symmetric primitives? |
|
We don't currently use them with the |
|
I guess I'm not sure how you'd use these traits with a signer in practice. Do you have a use case in mind? |
|
@rozbb the main advantage would probably be having a common trait-based API that can work across several key types, more for consistency than generic abstractions, IMO |
|
I took a look at using |
|
I need a trait based interface for signing key generation because I am working on an cryptographic primitive that is agnostic over its signature scheme. The I think it is fine to still implement these traits as they are meant generalize what the |
|
@carloskiki I would probably suggest using PKCS#8 for a common key init for that purpose, e.g. |
|
With PKCS#8 I need to first encode the bytes and then decode them again in order to generate a key, but I already have the bytes of the private key, I just want to instantiate a signing key with them... |
|
Either way it's a serialization of the key as bytes. PKCS#8 just includes algorithm information and is the "standard" private key format (and also offers features like password-based encryption). It can also be used to dynamically dispatch to various supported algorithms, if you're interested in that sort of thing. It's also available for all of the |
|
I understand that. In my case I still need I can remove the |
|
Edit: or for that matter, Edit again: opened RustCrypto/traits#1897 to discuss a fallible |
|
Maybe something like |
|
I removed the |
KeyInit and KeySizeUser for SigningKey and VerifyingKeyKeySizeUser for SigningKey and VerifyingKey
|
It should also be possible to impl the |
446c3c0 to
81f9ea4
Compare
|
Sorry for the churn with recent forced pushes. I implemented |
remove unused imports
Implements the
KeyInitandKeySizeUsertraits fromcrypto-commonforSigningKeyandVerifyingKey.