Skip to content

Instantly share code, notes, and snippets.

@yegorgavrilov
Forked from ansulev/convert-crt-to-jks.sh
Created February 21, 2022 11:32
Show Gist options
  • Save yegorgavrilov/6fde1f0b0d7d73ea6a808f4b7cca5c6d to your computer and use it in GitHub Desktop.
Save yegorgavrilov/6fde1f0b0d7d73ea6a808f4b7cca5c6d to your computer and use it in GitHub Desktop.
Convert .CRT y .KEY Certificates to JKS Keystore
# Convert it into pkcs12 format
openssl pkcs12 -export -out jenkins.p12 -inkey certificate.key -in certificate.crt -name "jenkins-cert"
# Create keystore if not exist
https://www.sslshopper.com/article-most-common-java-keytool-keystore-commands.html
# Import
keytool -importkeystore -srckeystore jenkins.p12 -srcstoretype pkcs12 -destkeystore keystore.jks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment