Verify SSL Certificate matches Private Key: Difference between revisions

From Leo's Notes
This page was last edited on 2 September 2019, at 02:08.
Created page with "When given a private key and a signed SSL certificate, to validate whether the private key matches that of the certificate: {{highlight|lang=terminal|code= # openssl x509 -mo..."
 
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
{{highlight|lang=terminal|code=
{{highlight|lang=terminal|code=
# openssl x509 -modulus -noout -in server.crt
# openssl x509 -modulus -noout -in server.crt
Modulus=BEF773CAF4790FD5D83F12B655B46914352768A98E63ACA41230EE088EF2E225FF7FB6E18C39BFBCAC1CD86E587EFEFAA86564B52D0334615D91A6ED472A85E87610CFDF0F0F6288CB10A7D86CFA5D38A07043C5DB853C7A0740C02105E95199FAD1A2219AD54B73AED7DAFF45DEE41A791A91E58583BF783CE42B20A03EB2A592731D72FD48A115A2638A52D3DBABA94DE3CDAD5E35F77320B3FD2B1078DC192E0648C14A204F920869E46BA79930C22D8698E5E5FCE2BDD8A522FDA5AD54F1703BB7CD9D2F7AD195603844983DBBE3FAEA19108A283BC61D185284048116E7DE05938AC393E7D068CB4C5F7A789597E3838F9E1D9C992618EED3A2A77628FF
Modulus=BEF773CAF4790...
 
# openssl rsa -modulus -noout -in server.key
# openssl rsa -modulus -noout -in server.key
Modulus=BEF773CAF4790FD5D83F12B655B46914352768A98E63ACA41230EE088EF2E225FF7FB6E18C39BFBCAC1CD86E587EFEFAA86564B52D0334615D91A6ED472A85E87610CFDF0F0F6288CB10A7D86CFA5D38A07043C5DB853C7A0740C02105E95199FAD1A2219AD54B73AED7DAFF45DEE41A791A91E58583BF783CE42B20A03EB2A592731D72FD48A115A2638A52D3DBABA94DE3CDAD5E35F77320B3FD2B1078DC192E0648C14A204F920869E46BA79930C22D8698E5E5FCE2BDD8A522FDA5AD54F1703BB7CD9D2F7AD195603844983DBBE3FAEA19108A283BC61D185284048116E7DE05938AC393E7D068CB4C5F7A789597E3838F9E1D9C992618EED3A2A77628FF
Modulus=BEF773CAF4790...
}}
}}


If the two modulus matches, the private key is for the certificate.
If the two modulus matches, the private key is for the certificate.


[[Category:Linux]]
== See Also ==
* https://support.comodo.com/index.php?/Knowledgebase/Article/View/684/17/how-do-i-verify-that-a-private-key-matches-a-certificate-openssl
 
{{Navbox Linux}}[[Category:Linux]]
{{Navbox Certificates}}[[Category:Certificates]]

Latest revision as of 02:08, 2 September 2019

When given a private key and a signed SSL certificate, to validate whether the private key matches that of the certificate:

# openssl x509 -modulus -noout -in server.crt
Modulus=BEF773CAF4790...

# openssl rsa -modulus -noout -in server.key
Modulus=BEF773CAF4790...

If the two modulus matches, the private key is for the certificate.

See Also