Skip to content

Instantly share code, notes, and snippets.

@txbm
Created December 25, 2021 04:07
Show Gist options
  • Save txbm/20f08056eb4a3c0faceaa44f68454e95 to your computer and use it in GitHub Desktop.
Save txbm/20f08056eb4a3c0faceaa44f68454e95 to your computer and use it in GitHub Desktop.
openssl scripts
#!/usr/bin/env bash
_out_ext=${1#*.}
_out_ext=${_out_ext%%.*}
_out="${1%%.*}-chain.${_out_ext}.pfx"
_crtfile=combined.crt.pem
# _cmd="openssl pkcs12 -export -keypbe NONE -certpbe NONE -nomaciter -passout pass: -out ${_out} -inkey ${2} -in ${1} -certfile ${_crtfile}"
_cmd="openssl pkcs12 -export -passout pass: -out ${_out} -inkey ${2} -in ${1} -certfile ${_crtfile}"
>${_crtfile} cat ${@:3}
${_cmd}
rm "${_crtfile}"
#!/usr/bin/env bash
openssl crl2pkcs7 -nocrl -certfile "${1}" | openssl pkcs7 -print_certs -text -noout
#!/usr/bin/env bash
openssl pkcs12 \
-in "${1}" \
-info \
-passin pass:
#!/usr/bin/env bash
openssl req -noout -text -in "${1}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment