Saturday, November 4, 2017

How to verify if CSR - Certificate Request and SSL certificate - Public Key are using same private key

To plain display certificate, you can use the following:

Display certificate:

CSR:
openssl req -in req.csr -noout -text

Certificate - Public Key:
openssl x509 -in cert.cer -noout -text


In order to make sure those use the same private key, modulus section shall be the same.
So, all the below shall match:

Private Key:
openssl rsa -noout -modulus -in private.key
 

CSR:
openssl req -noout -modulus -in req.csr

Certificate - Public Key:
openssl x509 -noout -modulus -in cert.cer

No comments:

Post a Comment