Initial import

This commit is contained in:
2017-02-21 02:14:51 +01:00
commit 6846bebd83
9 changed files with 799 additions and 0 deletions

23
bundle_certs.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
#
# Convert PEM Certificate to ca-bundle.crt format
#
# example:
# ./bundle_certs.sh myserver.crt >myserver.chain
# ./bundle_certs.sh intermediate.crt >>myserver.chain
# ./bundle_certs.sh root.crt >>myserver.chain
test ! $1 && printf "Usage: `basename $0` certificate" && exit 1
# Friendly Name and Underline Friendly Name with equal signs
openssl x509 -in $1 -text -noout | sed -e 's/^ *Subject:.*CN=\([^,]*\).*/\1/p;t c' -e 'd;:c' -e 's/./=/g'
# Output Fingerprint and swap = for :
openssl x509 -in $1 -noout -fingerprint | sed -e 's/=/: /'
# Output PEM Data:
echo 'PEM Data:'
# Output Certificate
openssl x509 -in $1
# Output Certificate text swapping Certificate with Certificate Ingredients
openssl x509 -in $1 -text -noout | sed -e 's/^Certificate:/Certificate Ingredients:/'