commit f3236f00188124c96278d8dd8959675b25ce5c7d parent 59485962b917e5d0d3aaff0fecc6fd10fa29416b Author: parazyd <parazyd@dyne.org> Date: Thu, 1 Mar 2018 06:00:03 +0100 Add rpgpgsign. Diffstat:
A | bin/rpgpgsign | | | 41 | +++++++++++++++++++++++++++++++++++++++++ |
1 file changed, 41 insertions(+), 0 deletions(-)
diff --git a/bin/rpgpgsign b/bin/rpgpgsign @@ -0,0 +1,41 @@ +#!/bin/sh + +boundary="FuNkAdEliC" +_cd="Content-Disposition: inline" + +email="$(cat)" + +headers="$(printf "$email" | sed '/^$/q' | sed "s/Content-Type.*/$_cd/")" +emabody="$(printf "$email" | sed '1,/^$/d' | sed 's/ $/=20/')" + +signature="$(cat <<EOM | sed 's/$/\r/' | gpg -baq --batch)" +Content-Type: text/plain; charset=utf-8 +$_cd +Content-Transfer-Encoding: quoted-printable + +$emabody +EOM + + +cat <<EOF | sed 's/$/\r/' +$headers +Content-Type: multipart/signed; micalg=pgp-sha512; + protocol="application/pgp-signature"; boundary="$boundary" +Content-Disposition: inline + + +--$boundary +Content-Type: text/plain; charset=utf-8 +$_cd +Content-Transfer-Encoding: quoted-printable + +$emabody + +--$boundary +Content-Type: application/pgp-signature; name="signature.asc" +Content-Description: Digital signature + +$signature + +--$boundary +EOF