How to use p256 with SubjectPublicKeyInfo and CertificateBuilder as a signer #1005
-
I couldn't figure this out from the docs and I didn't see an example, and I got lost in the traits and generic constraints. AFAICT p256 stuff implements all the right traits, and I'm on the most recent versions of all published libraries. I have
Where I'm using it as the signer this compile error appears:
FWIW Sorry if this is obvious, between the generics/traits and all the PKI key types and encodings I ran out of footholds. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
Forgot
|
Beta Was this translation helpful? Give feedback.
-
Re: examples, https://docs.rs/ecdsa/latest/ecdsa/struct.SigningKey.html says
|
Beta Was this translation helpful? Give feedback.
-
It seems like In the meantime you can work around this by making a copy of the key: SubjectPublicKeyInfoOwned::from_key(*priv_key.verifying_key()).unwrap()
I think you need to include the |
Beta Was this translation helpful? Give feedback.
-
The compiler message notes what you need to do:
It needs to be an ASN.1 DER encoded signature, however Use |
Beta Was this translation helpful? Give feedback.
It seems like
SubjectPublicKeyInfoOwned::from_key
has a somewhat annoying bound and should probably borrow its input /cc @balooIn the meantime you can work around this by making a copy of the key:
I think you need to include the
sha2
crate directly and enable itsoid
feature. The need for this will go away in the next breaking release.