Created
February 11, 2016 04:55
-
-
Save mcpherrinm/2f0fdb0f3155f270ca31 to your computer and use it in GitHub Desktop.
pem support wrappers for der2ascii
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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