I am using keytool
to create a csr. I wonder what is the difference between the options -genkey
and -genkeypair
. My understanding is that -genkey
creates only private key and -genkeypair
creates both private and public key. If so, how do I get the public key of the private key which is created using -genkey
.
Per https://docs.oracle.com/javase/8/docs/technotes/tools/unix/keytool.html, this keytool flag was named -genkey in earlier releases. While the old name is still supported, -genkeypair is preferred going forward.
So essentially, both are the same