Java - generating a self-signed public key
less than 1 minute read
1
2
3
4
5
6
7
8
9
10
1. Generate self - signed public key
$JAVA _ HOME / bin / keytool - genkey - alias test _ alias -- keyalg RSA - keystore test _ key . jks
- keysize 2048 - dname "CN=Test, OU=PAV, O=PROS, L=HOU, ST=TX, C=US" - keypass test _ password
- storepass test _ password
2. Generate a certificate signature request with a self - signed public key
$JAVA _ HOME / bin / keytool - certreq - alias certalias - file test _ cert _ req . csr - keystore test _ key . jks
- storepass test _ password
3. Importing a root certificate files
$JAVA _ HOME / bin / keytool - import - v - trustcacerts - alias ExternalCARoot - file Test _ CARoot . crt
- keystore test _ key . jks - storepass test _ password