Eric
Eric

Reputation: 4301

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

Upvotes: 6

Views: 1329

Answers (1)

Peter Ritchie
Peter Ritchie

Reputation: 35870

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

Upvotes: 1

Related Questions