Skip to content

How to use p256 with SubjectPublicKeyInfo and CertificateBuilder as a signer #1005

Answered by tarcieri
andrewbaxter asked this question in Q&A
Discussion options

You must be logged in to vote

SubjectPublicKeyInfoOwned::from_key(priv_key.verifying_key()).unwrap()

It seems like SubjectPublicKeyInfoOwned::from_key has a somewhat annoying bound and should probably borrow its input /cc @baloo

In the meantime you can work around this by making a copy of the key:

SubjectPublicKeyInfoOwned::from_key(*priv_key.verifying_key()).unwrap()

error[E0277]: the trait bound OidSha256: AssociatedOid is not satisfied

I think you need to include the sha2 crate directly and enable its oid feature. The need for this will go away in the next breaking release.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@baloo
Comment options

@andrewbaxter
Comment options

Answer selected by andrewbaxter
Comment options

You must be logged in to vote
1 reply
@andrewbaxter
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants