Skip to content

Extracting key of type ECDA or ECDH from X509Certificate2 object #113208

Answered by bartonjs
MukilanP asked this question in Q&A
Discussion options

You must be logged in to vote

If by "extract" you mean "export", then you can generally pick one arbitrarily. If you mean "use" then you have to pick the one that meets your needs.

The certificate's Key Usage can say that the key should only be used for signing, in which case it's ECDSA, or that it should only be used for key agreement, in which case it's ECDH. But if it's flexible, you get to pick.

https://source.dot.net/#System.Security.Cryptography/System/Security/Cryptography/X509Certificates/ECDsaCertificateExtensions.cs,3e517b2c43fe7cfc

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by MukilanP
Comment options

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

@MukilanP
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