Skip to content

Trust Anchor Installation for Java keystores using keytool⚓︎


Java keystore⚓︎

Bash
1
2
3
4
5
6
7
8
9
# Copy the pem based certificates for both your Root and Intermediate to the keystore directory
# keystores are most commonly stored in $JAVA_HOME/jre/lib/security/

keytool -import -v -trustcacerts -alias corp-intermediate -file INTERMEDIATE.pem -keystore cacerts
keytool -import -v -trustcacerts -alias corp-root -file ROOT.pem -keystore cacerts

# Verify your PKI certs are now listed in the keystore
keytool -list -keystore cacerts
keytool -list -v -keystore cacerts