Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -e
- if [[ $# -lt 2 ]]
- then
- echo "Usage: $0 <filename.p12> <key-name: ie. app-free-dev>"
- exit
- fi
- function convert_cert() {
- p12_file=$1
- name=$2
- openssl pkcs12 -clcerts -nokeys -out $name.cert -in $p12_file
- openssl pkcs12 -nocerts -out $name.enc.pem -in $p12_file
- openssl rsa -in $name.enc.pem -out $name.pem
- rm $name.enc.pem
- echo "Created $name.pem and $name.cert"
- }
- convert_cert $1 $2
Add Comment
Please, Sign In to add comment