formats

Check key length from the command line with OpenSSL



To check the key length of a certificate, use the openssl command.


Here is how to check an RSA private key length:

$ openssl rsa -text -noout -in private.key



The top of the output will have:

Private-Key: (1024 bit)

For a certificates (.crt or .pem), use this command:

$ openssl x509 -text -noout -in certificate.crt 



.p12 certs:

$ openssl pkcs12 -info -in keyStore.p12



The output will have the key length in a dump of all other certificate info:

RSA Public Key: (2048 bit)




Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Home linux Check key length from the command line with OpenSSL