JKS Creation and Management
Creating a Java Keystore (JKS) with a Self-Signed Certificate
To create a Java Keystore (JKS) with a self-signed certificate, use the following command:
keytool -genkeypair -alias myalias -keyalg RSA -keystore keystore.jks -storepass password -validity 365
Converting PKCS12 to JKS
To convert an existing PKCS12 keystore to JKS format, execute:
keytool -importkeystore -srckeystore keystore.p12 -srcstoretype pkcs12 -destkeystore keystore.jks -deststoretype jks
Listing Certificates in a JKS
To list all certificates in a JKS file, run:
keytool -list -v -keystore keystore.jks -storepass password
Was this page helpful?