Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Created May 14, 2021 04:27
Show Gist options
  • Save guitarrapc/1b5e000e500b63e98fd313f21ec6e46e to your computer and use it in GitHub Desktop.
Save guitarrapc/1b5e000e500b63e98fd313f21ec6e46e to your computer and use it in GitHub Desktop.
export rsa private key and cert from pkcs (.p12) file. Used for Apple Push Notification Certificate extraction.
#!/bin/bash
for item in *.p12
do
filename="${item%%.*}"
openssl pkcs12 -in "${item}" -nodes -nocerts -passin pass:"" | openssl rsa -out "${filename}-key.pem"
openssl pkcs12 -in "${item}" -nodes -nokeys -passin pass:"" | openssl x509 -out "${filename}-cert.pem"
done
@guitarrapc
Copy link
Author

use your password on pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment