about summary refs log tree commit diff
path: root/contrib/mp7m
blob: f8ca257d1a7f98c523f0f7810e1e7377f758008a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/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