Java Key Store: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
== Manipulating Java Key Store ==
== Manipulating Java Key Store ==
<syntaxhighlight lang="c">
<syntaxhighlight lang="bash">
# show trusted root ca entries with empty/blank password
# show trusted root ca entries with empty/blank password
keytool -keystore "$JAVA_HOME/jre/lib/security/cacerts" -list
keytool -keystore "$JAVA_HOME/jre/lib/security/cacerts" -list
Line 15: Line 15:
echo -e "GET / HTTP/1.0\r\n" | openssl s_client \
echo -e "GET / HTTP/1.0\r\n" | openssl s_client \
-connect $service -CAfile chorke_client.pem
-connect $service -CAfile chorke_client.pem
</syntaxhighlight>
<syntaxhighlight lang="bash">
# import certificate with alias in java security
keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias samarootca -file samarootca.cer
keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias samasubca -file samasubca.cer
keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias billsoft -file billsoft.crt
</syntaxhighlight>
</syntaxhighlight>



Revision as of 03:11, 27 February 2018

Manipulating Java Key Store

# show trusted root ca entries with empty/blank password
keytool -keystore "$JAVA_HOME/jre/lib/security/cacerts" -list

# show trusted certificate entries with store password
keytool -keystore "$HOME/.chorke/jks/chorke.jks" -list

# change proprietary jks format to pkcs12
keytool -importkeystore -srckeystore chorke_source.jks \
-destkeystore chorke_target.jks -deststoretype pkcs12

# debugging certificate handshacking
service='api.chorke.org:5443/soap/services';\
echo -e "GET / HTTP/1.0\r\n" | openssl s_client \
-connect $service -CAfile chorke_client.pem
# import certificate with alias in java security
keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias samarootca -file samarootca.cer
keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias samasubca -file samasubca.cer
keytool -import -keystore $JAVA_HOME/jre/lib/security/cacerts -alias billsoft -file billsoft.crt

References