Conjur - How to verify if a key is associated to a certificate using OpenSSL?

Conjur - How to verify if a key is associated to a certificate using OpenSSL?

81
Created On 11/10/26 10:58 AM - Last Modified 11/10/26 16:08 PM


Question


How to verify if a Key is associated to a Certificate using OpenSSL?

Environment


N/A

Answer


To compare the Key and the Certificate, you should execute the following commands.
The second command will require the private key password. Compare the output from both commands.
If both md5 checksums match, the key and certificate go together.

openssl x509 -modulus -noout -in conjur-authn-k8s-cjrpre-ca-cert.txt | openssl md5
c61944846fd055ddb94c21374d76c75b
 

openssl rsa -modulus -noout -in conjur-authn-k8s-cjrpre-ca-key.txt | openssl md5
Enter pass phrase for cs_privkey.txt:
c61944846fd055ddb94c21374d76c75b

where:
conjur-authn-k8s-cjrpre-ca-cert.txt is the certificate.
conjur-authn-k8s-cjrpre-ca-key.txt is the private key.

In the previous example, as both command outputs are identical, the certificate and the key match.
If you are unable to find the private key that corresponds to your certificate, you will need to replace the certificate.


Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000001SboCAE&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail