CGI and GnuPG

Anthony E. Greene agreene@pobox.com
Wed Jun 27 06:46:01 2001


  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.
  Send mail to mime@docserver.cac.washington.edu for more info.

---1463811839-95531894-993617074=:11541
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Tue, 26 Jun 2001, Oliver Crow wrote:

>I am trying to run GnuPG from a CGI script. The goal of the script is to
>PGP encrypt some data submitted to a web form using a predefined key, and
>send that data to a predefined email address. There is no neccessity to
>perform any validity checking on the keys, since they have been manually
>verified.
See attached options file and script. There's no error checking in the script, but it works. Tony -- Anthony E. Greene <agreene@pobox.com> <http://www.pobox.com/~agreene/> PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D Chat: AOL/Yahoo: TonyG05 MSN: te_greene Linux. The choice of a GNU Generation. <http://www.linux.org/> ---1463811839-95531894-993617074=:11541 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="gpgtest.cgi" Content-Transfer-Encoding: BASE64 Content-ID: <Pine.LNX.4.21.0106270044340.11541@cp5340.localdomain> Content-Description: Content-Disposition: attachment; filename="gpgtest.cgi" IyEvdXNyL2Jpbi9wZXJsIC13DQojDQojIEV4YW1wbGUgb2YgdXNpbmcgZ251 cGcgdG8gZW5jcnlwdCBmb3JtIGRhdGEuDQojDQojIEFudGhvbnkgRS4gR3Jl ZW5lIDxhZ3JlZW5lQHBvYm94LmNvbT4NCiMNCiMgQXNzdW1lcyB0aGF0IGtl eXJpbmdzIGFyZSBpbiAvaG9tZS9odHRwZC9nbnVwZywgd2hpY2ggaXMgb3du ZWQgYnkNCiMgdGhlIHdlYiBzZXJ2ZXIgdXNlcmlkIChub2JvZHkpLg0KDQoj IEluaXRpYWxpemUgdGhlIENHSSBmb3JtIG9iamVjdC4NCnVzZSBDR0k7DQok Zm9ybSA9IG5ldyBDR0k7DQoNCiMgU2V0IHRoZSB2YXJpYWJsZXMgdXNlZCB0 byBlbmNyeXB0IGFuZCBzZW5kIHRoZSBtYWlsLg0KJHJlY2lwaWVudCA9ICd3 ZWJtYXN0ZXJAbG9jYWxob3N0JzsNCiRzdWJqZWN0ID0gJ0dudVBHIHRlc3Qn Ow0KJGtleWlkID0gJzB4NkM5NDIzOUQnOw0KJGtleXJpbmdkaXIgPSAnL2hv bWUvaHR0cGQvZ251cGcnOw0KJG1haWxwcm9nID0gInwgZ3BnIC0taG9tZWRp ciAka2V5cmluZ2RpciAtLWFsd2F5cy10cnVzdCAtZWEgLXIgJGtleWlkIHwg bWFpbCAtcyAnJHN1YmplY3QnICRyZWNpcGllbnQiOw0KDQojIFNlbmQgdGhl IG1lc3NhZ2UuDQpvcGVuKE1BSUwsJG1haWxwcm9nKTsNCnByaW50IE1BSUwg IjxodG1sXG4iOw0KcHJpbnQgTUFJTCAiPGhlYWQ+PHRpdGxlPldlYiBGb3Jt IERhdGE8L3RpdGxlPjwvaGVhZD5cbiI7DQpwcmludCBNQUlMICI8Ym9keSBi Z2NvbG9yPVwiI2ZmZmZmZlwiPlxuIjsNCnByaW50IE1BSUwgJGZvcm0tPmR1 bXA7DQpwcmludCBNQUlMICI8L2JvZHk+PC9odG1sPlxuIjsNCmNsb3NlKE1B SUwpOw0KDQojIE5vdGlmeSB0aGUgdXNlciB0aGF0IHRoZSBtZXNzYWdlIHdh cyBzZW50Lg0KcHJpbnQgIkNvbnRlbnQtVHlwZTogdGV4dC9wbGFpblxuXG4i Ow0KcHJpbnQgIk1lc3NhZ2Ugc2VudC5cbiI7DQpleGl0Ow0KDQo= ---1463811839-95531894-993617074=:11541 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=options Content-Transfer-Encoding: BASE64 Content-ID: <Pine.LNX.4.21.0106270044341.11541@cp5340.localdomain> Content-Description: Content-Disposition: attachment; filename=options IyBPcHRpb25zIGZvciBHbnVQRw0KIw0KIyBVbmxlc3MgeW91IHlvdSBzcGVj aWZ5IHdoaWNoIG9wdGlvbiBmaWxlIHRvIH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