Archived Forum Post

Index of archived forum posts

Question:

private and public key strings are matched

Aug 21 '15 at 08:56

Verifies that a pair of "internal" RSA private and public key strings are matched I like to check that a private key file is matched with the public key in an X.509 certificate how I can do?


Accepted Answer

According to the comments in this example of the ChilkatRsa object:

http://www.example-code.com/vb/rsa_keynotes.asp

The modulus and exponent will match in the public and private key if they are a match.

With regard to a X.509 certificate, though I haven't tried it myself, I think you should be able to use the ChilkatCert object to import the X.509 file/bytes, export it to XML, then examine the XML to compare compare the public & private exponent and modulus values.