-2

keytool command is supposed to generate public-private key pairs. I use the following command to generate the public-private key pair:

keytool -genkey -alias test -keystore test keystore -validity 1000

If I open and see the keystore , I see the following:

C:\Program Files\Java\jdk1.7.0_25\bin>keytool -list -keystore testkeystore Enter keystore password:

Keystore type: JKS Keystore provider: SUN

Your keystore contains 1 entry

test, May 1, 2016, PrivateKeyEntry, Certificate fingerprint (SHA1): 0C:FB:51:84:1C:3F:74:C7:1C:F9:F1:DE:E6:89:90:E6: 39:78:F3:FD

I am confused as to what is the public key here and what is the private key here. Can anyone help ?

seenukarthi
  • 8,241
  • 10
  • 47
  • 68
user3276247
  • 1,046
  • 2
  • 9
  • 24

1 Answers1

0

The entry contains both the private key and a self-signed certificate containing the public key.

user207421
  • 305,947
  • 44
  • 307
  • 483
  • Whatever I have put in the question is the exact content I can see. Which is then the private key here and what part will constitute the self signed certificate containing the public key. – user3276247 May 02 '16 at 13:06