Java – generating a self-signed public key

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
This entry was posted in Java, Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s