Skip to content

Instantly share code, notes, and snippets.

@mcpherrinm
Created February 11, 2016 04:55
Show Gist options
  • Save mcpherrinm/2f0fdb0f3155f270ca31 to your computer and use it in GitHub Desktop.
Save mcpherrinm/2f0fdb0f3155f270ca31 to your computer and use it in GitHub Desktop.
pem support wrappers for der2ascii
#!/bin/bash
while [[ $# > 0 ]]; do
case $1 in
-i|-in|--in) input="-i $2"
shift 2
;;
-o|-out|--out) output="-out $2"
shift 2
;;
*) echo "Usage of ascii2pem:"
echo " -i string"
echo " input file to use (defaults to stdin)"
echo " -o string"
echo " output file to use (defaults to stdout)"
exit -1
;;
esac
done
ascii2der $input | openssl x509 $output -inform DER -outform PEM
#!/bin/bash
while [[ $# > 0 ]]; do
case $1 in
-i|-in|--in) input="-in $2"
shift 2 ;;
-o|-out|--out) output="-o $2"
shift 2 ;;
*) echo "Usage of ascii2pem:"
echo " -i string"
echo " input file to use (defaults to stdin)"
echo " -o string"
echo " output file to use (defaults to stdout)"
exit -1 ;;
esac
done
openssl x509 $input -inform PEM -outform DER | der2ascii $output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment