mblaze/contrib/mp7m
2018-03-20 15:33:14 +01:00

16 lines
272 B
Bash
Executable File

#!/bin/sh
# mp7m - decode S/MIME .p7m format
tmp=$(mktemp -t mp7m.XXXXXX)
trap "rm -f '$tmp'" INT TERM EXIT
cat >"$tmp"
if openssl pkcs7 -print_certs <"$tmp" |
openssl smime -verify -in "$tmp" -inform DER -noverify -signer /dev/stdin
then
exit 64
else
exit 63
fi