keytool command

I am confused about the keytool and certs in general

What part of this command (which parameter) actually performs a 'self-sign'.

What part of the command (which parm) makes it a private key.  Why is this a private key

keytool -genkey -alias First_Java_Cert -keyalg RSA -keystore /home/ssl/keystore.jks -storepass passw0rd
-dname "CN=first, O=IBM, C=GB" -keypass passw0rd
Anthony LuciaAsked:
Who is Participating?
 
Dave HoweConnect With a Mentor Software and Hardware EngineerCommented:
the "genkey" for the standard java keytool generates both a keypair and a self-signed certificate.
0
 
Anthony LuciaAuthor Commented:
You said the genkey created

- self signed

- Key pair

I assume by keypair you mean that it created a public and private key

So does that mean that both a public and private key are contained within the cert that was created ?
0
 
Dave HoweSoftware and Hardware EngineerCommented:
No. The private key never leaves the jar file, the public key is contained in the cert.

This is exactly the same system as you use for https certificates, just the java way to create and store them.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.