X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/distorted-keys/blobdiff_plain/f93aa26608c5fee11e7297608f6f125404f840e8..8e580e354109b877fe51a89b87c74a824563d8d4:/ktype.reop diff --git a/ktype.reop b/ktype.reop new file mode 100644 index 0000000..e9360f6 --- /dev/null +++ b/ktype.reop @@ -0,0 +1,74 @@ +### -*-sh-*- +### +### Key type for REOP +### +### (c) 2015 Mark Wooding +### + +###----- Licensing notice --------------------------------------------------- +### +### This file is part of the distorted.org.uk key management suite. +### +### distorted-keys is free software; you can redistribute it and/or modify +### it under the terms of the GNU General Public License as published by +### the Free Software Foundation; either version 2 of the License, or +### (at your option) any later version. +### +### distorted-keys is distributed in the hope that it will be useful, +### but WITHOUT ANY WARRANTY; without even the implied warranty of +### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +### GNU General Public License for more details. +### +### You should have received a copy of the GNU General Public License +### along with distorted-keys; if not, write to the Free Software Foundation, +### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +defprops k_props <>$tmp/ct + cat $tmp/ct +} + +k_decrypt () { + base=$1 nub=$2 + + sed -n " + /^-----BEGIN REOP PUBLIC KEY-----\$/,/^-----END REOP PUBLIC KEY-----\$/ \ + w $tmp/pub + /^-----BEGIN REOP ENCRYPTED MESSAGE-----\$/,/^-----END REOP ENCRYPTED MESSAGE-----\$/ \ + w $tmp/ct" + REOP_PASSPHRASE=$(cat "$nub") \ + reop -D -s"$base/sec" -p$tmp/pub -m- -x$tmp/ct +} + +k_sign () { + base=$1 nub=$2 + + REOP_PASSPHRASE=$(cat "$nub") \ + reop -S -s"$base/sec" -m- -x- +} + +k_verify () { + base=$1 sig=$3 + + echo "$sig" >$tmp/sig + reop -Vq -p"$base/pub" -m- -x$tmp/sig +} + +###----- That's all, folks --------------------------------------------------