Java Keytool Examples Menu

Creating a Elliptical Curve Cartography (ECC) Certificate for a Certificate Authority (CA) w/ PKCS12 Keystore

Elliptical Curve Cartography (ECC) Certificate for a Certificate Authority (CA) w/ PKCS12 Keystore

Here is how to create keys and the keystore ***Size of keypair - Range from 112 to 571 (inclusive) - Default is 256
 Copy keytool -genkeypair -keysize 384 -sigalg SHA384withECDSA -keyalg EC -alias serverkey -keypass changeit -validity 365 -dname "CN=Name,OU=IT,O=Mega,L=Planet,ST=CO,C=US" -storetype pkcs12 -keystore that.keystore -storepass changeit 
Check the keys and keystore creation
 Copy keytool -list -v -keystore that.keystore -storetype pkcs12 -storepass changeit 
Create a Certificate Signing Request (CSR) for a Certificate Authority (CA)
 Copy keytool -certreq -v -file site.csr -sigalg SHA384withECDSA -alias serverkey -keypass changeit -keystore that.keystore -storetype pkcs12 -storepass changeit -ext san=dns:server.example.com,dns:server,ip:10.10.10.10,ip:::1 
Check the Certificate Signing Request (CSR) for Certified Authority (CA)
 Copy keytool -printcertreq -file site.csr 
Check the Certificate from the CA where the CSR was signed
 Copy keytool -printcert -file site.cer or .pem 
Import the Root Certificate from the Certificate Authority (CA) to the KeyStore
 Copy Keytool -import -trustcacerts -alias CAroot -keystore that.keystore -file CARoot.cer -storetype pkcs12 -storepass changeit 
Import the Intermediate Certificate(s) from the Certificate Authority (CA) to the KeyStore
 Copy Keytool -import -trustcacerts -alias CAinter1 -keystore that.keystore -file CAInter.cer  -storetype pkcs12 -storepass changeit 
Import the Site/Server Certificate from the Certificate Authority (CA) to the KeyStore
 Copy keytool -importcert -alias sitecert -file site.pem -storetype pkcs12 -keystore that.keystore -storetype pkcs12 -storepass changeit