home *** CD-ROM | disk | FTP | other *** search
/ YPA: Your Privacy Assured / YPA.ISO / other_goodies / utilities / amigaelm-v6.lha / c / EncryptMsg < prev    next >
AmigaDOS Script File  |  1994-08-21  |  1KB  |  49 lines

  1. .KEY cryptfile/A,cryptmode/A
  2. .BRA {
  3. .KET }
  4.  
  5. ;
  6. ; EncryptMsg using PGP
  7. ;
  8. ; written by Peter Simons <simons@peti.GUN.de>
  9. ;
  10. ; [you need "AmigaPGP 2.3a.3" or higher, -amk]
  11. ;
  12.  
  13. FailAt 1
  14.  
  15. SplitHeadBody <"{cryptfile}" T:AmiElm-Header.$process T:AmiElm-Body.$process
  16.  
  17. If "{cryptmode}" EQ "ENCRYPT"
  18.         RequestString RECIPIENTS "Please enter recipient(s) ID(s)..." 256
  19.         PGP -ftea <T:AmiElm-Body.$process >"{cryptfile}.asc" `Echo $RECIPIENTS`
  20.         UnSet RECIPIENTS
  21. Else
  22. If "{cryptmode}" EQ "SIGN"
  23.         PGP -ftsa <T:AmiElm-Body.$process >"{cryptfile}.asc" +clearsig=on
  24. Else
  25. If "{cryptmode}" EQ "ENCRYPT+SIGN"
  26.         RequestString RECIPIENTS "Please enter recipient(s) ID(s)..." 256
  27.         PGP -ftesa <T:AmiElm-Body.$process >"{cryptfile}.asc" `Echo $RECIPIENTS`
  28.         UnSet RECIPIENTS
  29. Else
  30.     Echo "elm: Encrypt mode *"{cryptmode}*" not supported by *"EncryptMsg*" script!"
  31.     Echo "elm: WARNING! Mail not modified, sending mail NOT encrypted ..."
  32.     Delete T:AmiElm-Header.$process T:AmiElm-Body.$process QUIET FORCE
  33.     Quit
  34. EndIf
  35. EndIf
  36. EndIf
  37.  
  38. ;
  39. ; build new message from header and body
  40. ; and get rid of our temporary files
  41. ;
  42.  
  43. Delete {cryptfile} QUIET FORCE
  44. Rename T:AmiElm-Header.$process "{cryptfile}"
  45. Echo "*N" >>"{cryptfile}" NOLINE
  46. Type "{cryptfile}.asc" >>"{cryptfile}"
  47. Delete "{cryptfile}.asc" T:AmiElm-Header.$process T:AmiElm-Body.$process QUIET FORCE
  48.  
  49.