Skip to content

Instantly share code, notes, and snippets.

@oremj
Created January 19, 2017 18:50
Show Gist options
  • Select an option

  • Save oremj/cc277159797b9c6127c0d4685cdb57c3 to your computer and use it in GitHub Desktop.

Select an option

Save oremj/cc277159797b9c6127c0d4685cdb57c3 to your computer and use it in GitHub Desktop.
Convert pkcs12 to pem key and cert
#!/bin/bash
set -e
P12CERT=$1
CERTNAME=${P12CERT%.p12}
openssl pkcs12 -in "$P12CERT" -nocerts -nodes -out "${CERTNAME}.key.pem"
openssl pkcs12 -in "$P12CERT" -clcerts -nokeys -out "${CERTNAME}.crt.pem"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment