On a previous post I wrote
Could some one please post an example of a keytool creating a private key (and please explain what about the command makes the key private instead of public)
I was given an excellent reply
there is no such command. you always generate a keypair, which generates both a private and a public key. the difference is that in the standard sun keytool, there is no way to extract the private key, you can merely export either a certificate or a CSR with the public key.
But this led me to wonder.... What if I need to export a private key. How do I do it.
Also, when I use the keytool to create a certificate, can I assume the certificate contains the public key ?