Skip to content

Instantly share code, notes, and snippets.

@ishida
Created May 17, 2012 17:25
Show Gist options
  • Save ishida/2720364 to your computer and use it in GitHub Desktop.
Save ishida/2720364 to your computer and use it in GitHub Desktop.
private key in old jks + p7s -> p12 (UNTESTED)
$ keytool -importkeystore -srckeystore OLD_KEYSTORE.jks -destkeystore OLD_KEYSTORE.p12 -srcstoretype JKS -deststoretype PKCS12 -srcalias MY_ALIAS -destalias MY_ALIAS
$ openssl pkcs12 -in OLD_KEYSTORE.p12 -nocerts -nodes -out PRIVATE.key
$ openssl pkcs7 -in NEW_CERT.p7s -out NEW_CERT.cer -print_certs
$ openssl pkcs12 -export -in NEW_CERT.cer -inkey PRIVATE.key -out NEW_KEYSTORE.p12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment