Skip to content

Instantly share code, notes, and snippets.

@jayers99
Last active November 29, 2018 22:33
Show Gist options
  • Save jayers99/643dbed09351dfb12b814d40835ccc38 to your computer and use it in GitHub Desktop.
Save jayers99/643dbed09351dfb12b814d40835ccc38 to your computer and use it in GitHub Desktop.
# set a var name
mycertfile=<mycertfilename>
# to decrypt the private key
# this will ask you for a password
openssl pkey -outform PEM -in $mycertfile
# get all the nodes from pks file type
openssl pkcs12 -in $mycertfile -nodes
# decode the cert details
openssl x509 -in $mycertfile -text -noout
# including the location of the cert chain
openssl x509 -in $mycertfile -text -noout | grep 'CA Issuers - URI:'
# convert crt to pem cert chain
openssl x509 -in $mycertfile -inform der -outform PEM #-out $mycertfile.pem
# to export your encrypted private SSH key
openssl rsa -in ~/.ssh/jayers_rsa -out ~/.ssh/jayers_d_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment