decrypt_ssl 347 B

1234567891011121314151617
  1. #!/bin/sh
  2. #
  3. # Script to decrypt the key which is encrypted with openssl.
  4. # See /usr/share/doc/cryptsetup/examples/gen-ssl-key to create such a key.
  5. #
  6. decrypt_ssl () {
  7. echo "" >&2
  8. echo "Decrypting ssl key $1..." >&2
  9. if ! /usr/bin/openssl enc -aes-256-cbc -d -salt -in "$1" 2>/dev/null; then
  10. return 1
  11. fi
  12. return 0
  13. }
  14. decrypt_ssl "$1"
  15. exit $?