Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see a certificate keysize using keytool?

Tags:

java

keytool

When the certificate is created it is possible to configure -keysize option for command genkeypair.

Is it possible to see a certificate keysize using keytool?

I have tried these options without success:

keytool  -list –rfc

keytool  -list –v

Was not able to find it here: https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html#keytool_option_list

like image 687
Michael Avatar asked Nov 02 '15 11:11

Michael


2 Answers

This is not possible with keytool, but there is a GUI alternative called "KeyStore Explorer" that shows the key size:

KeyStore Explorer

like image 131
Omikron Avatar answered Nov 09 '22 14:11

Omikron


Actually, if I run the following command I will see the bit size listed under my Alias

keytool -list -v -keystore {name of keystore}

The following are lines I see on my private certificate (non-root cert)

Subject Public Key Algorithm: 2048-bit RSA key

like image 43
Nancy Forbes Avatar answered Nov 09 '22 15:11

Nancy Forbes