Keytool and Private Key

How can i get public/private keys with Keytool ?I made keytool -genkey..... but how can i see them ?Thank's
[136 byte] By [darkit] at [2007-9-26 1:39:38]
# 1

Hi,

To print out the contents of a keystore entry, use the -list command, as in

keytool -list -alias joe

If you don't specify an alias, as in

keytool -list

the contents of the entire keystore are printed.

To display the contents of a certificate stored in a file, use the -printcert command, as in

keytool -printcert -file certfile.cer

This displays information about the certificate stored in the file certfile.cer.

Note: This works independently of a keystore, i.e., you do not need a keystore in order to display a certificate that's stored in a file.

Hope this will help you.

Regards,

Anil.

Technical Support Engineer.

ramanil_indts at 2007-6-29 2:29:04 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 2
No. I need to know my public/private keys but not certificate. keytool -list - will print certificate
darkit at 2007-6-29 2:29:04 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 3
Hi,Please go through the following URL. http://www.javaworld.com/javaworld/jw-12-2000/jw-1215-security-2.html Hope this might help you.Regards,Anil.Developer Technical Support Engineer.
ramanil_indts at 2007-6-29 2:29:04 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...
# 4

NO :(( I have Oracle 8.1.7 with Apache. and when i use default certificate which is included in Apache, JSSE 1.0.2 says that hostname is the same as in certificate.

So i made my own certificate by keytool. And now there's an error in handshake, because private key which is included by default is for default certificate. So i need to know my private key for my certificate. I wrote a programm, which read keystore and then return Key.getEncoded() - but it doesn't look like private key.

darkit at 2007-6-29 2:29:04 > top of Java-index,Security,Java Secure Socket Extension (JSSE)...