Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Given two certificates, how can I verify that one was signed with the other's private key?

I have two X509Certificate2s. Call them toCheck and checkWith.

How can I check that toCheck was signed by the private key of checkWith?

Basically, I want the C# equivalent of Java's

toCheck.verify(checkWith.getPublicKey());

Thanks

like image 349
Eric Avatar asked Sep 20 '12 20:09

Eric


1 Answers

I'm not sure what the value of that would be. What if the certificate used to sign (checkWith) was revoked? It sounds like you'd have a false sense of validation.

If you want to validate a certificate, you can use the X509Certificate2.Verify method

like image 152
Peter Ritchie Avatar answered Oct 26 '22 18:10

Peter Ritchie