Scripting and CGI use of GPG

phil@Stimpy.netroedge.com phil@Stimpy.netroedge.com
Tue, 31 Aug 1999 13:44:19 -0700 (PDT)


Hey!  It works.  With a little help from Frank, I got everything working
great.  For those interested in doing some automated encypt+signing for
things like commerce servers, check out my simple CGI below:

---snip!---
#!/usr/bin/perl

use PGP::GPG::MessageProcessor;

print "Content-type: text/html\n\n";

$message[0]="This is just my bogus test message\n";
$message[1]="This is just my bogus test message line 2\n";

$messageProcessor = new PGP::GPG::MessageProcessor;
$passphrase="hellothere";
$recipient="phil\@stimpy.netroedge.com";
$messageProcessor->{extraArgs}   = [ '--homedir', '/home/nobody/.gnupg' ];
$messageProcessor->{encrypt} = 1;
$messageProcessor->{sign} = 1;   
$messageProcessor->{recipients} = [$recipient];
$messageProcessor->{interactive} = 0;
$messageProcessor->{armor}       = 1;
$messageProcessor->{passphrase} = $passphrase;
$success    = $messageProcessor->cipher( \@message );

print "<pre>";

print `env`;

print "testing-->\n\n";
print @message;
---snip!---

Thanks again!


Phil

------------------------------------------------------------
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR
   phil@netroedge.com -- http://www.netroedge.com/~phil
 PGP F16: 01 D2 FD 01 B5 46 F4 F0  3A 8B 9D 7E 14 7F FB 7A