/* AddPGPKey.spot Version 1.0 © 1994 by Chris Dee                           */
/*   (Based on Encrypt.spot Version 1.2 © 1993 by Wim Van Goethem)          */
/*                                                                          */
/* This Arexx script will add the (public) PGP key (if any) that is in the  */
/* current message when this script is selected. This script uses PGP which */
/* has been ported to the Amiga by Peter Simons.                            */
/*                                                                          */
/* For comments, remarks, bugs, etc. contact:                               */
/* Fidonet: 2:286/407.34 (Chris Dee)                                        */
/* Internet: cd@grafix.wlink.nl                                             */

/* Path were you keep PGP (must end on "/" or ":" or be empty) */
PGPpath = "Mail:Bin/"

address spot
options results

if ~show(Libraries,'rexxsupport.library') then
    if ~addlib("rexxsupport.library",0,-30,0) then exit

'saveascii TO T:pgptemp_a OVERWRITE NOTEARLINE NOORIGIN NOKLUDGES' /* Save the msg */

/* Add PGP key (if any) */
options failat 100
address command PGPpath'PGP -ka T:pgptemp_a'
if rc ~= 0 then do
    foo = delete('T:pgptemp_a')
    say ""
    say ""
    say "Please close window to quit."
    exit
    end

foo = delete('T:pgptemp_a')

/* Quit */
say ""
say ""
say "Please close window to quit."
exit
