Last active
June 24, 2024 08:11
-
-
Save abdul-sami/87b7cdc831b8fb986ac1 to your computer and use it in GitHub Desktop.
Export a Public Key Certificate from Java Key Store to Base 64 (PEM) Format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Method One: Using both Keytool and Openssl | |
keytool -export -keystore <keystore.jks> -alias <aliasName> -file publiccert.cer | |
openssl x509 -inform der -in publiccert.cer -out publiccert.pem | |
#Method Two: Direct conversion with only keytool (thanks to http://stackoverflow.com/a/6076689/552148) | |
keytool -exportcert -alias <selfsigned> -keystore <test-user.jks> -rfc -file <test-user.pem> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment