Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

generate pgp5 code Crypt::OpenPGP

by pentanol (Initiate)
on Jan 28, 2013 at 10:35 UTC ( #1015675=perlquestion: print w/ replies, xml ) Need Help??
pentanol has asked for the wisdom of the Perl Monks concerning the following question:

Hello,I want avoid use file, just use new certificate with input data. it says...
Signature Failed: No secret keyrings
use strict; use warnings; use Crypt::OpenPGP; use Crypt::OpenPGP::Certificate; use Crypt::OpenPGP::Key::Secret; my $pgp = Crypt::OpenPGP->new; my $message_body; $message_body .= $_ while <STDIN>; my $result = $pgp->handle( Data => $message_body ); my $file = 'really-from-me.txt'; my $key_id = '1234567890'; my $pass = 'foo bar'; my $sec = Crypt::OpenPGP::Key::Secret->new("DSA"); my $certpass = "asd123"; my $seccert = Crypt::OpenPGP::Certificate->new( Key => $sec, Passphrase => $certpass, Version => 4, ) || die "Certificate Failed: ",$pgp->errstr; my $signature = $pgp->sign( Data => $seccert, KeyID => $key_id, Passphrase => $pass, Detach => 1, Armour => 1, ) || die "Signature Failed: ",$pgp->errstr; my $ciphertext = $pgp->encrypt( Filename => $file, Recipients => $key_id, Armour => 1, ) || die "Encryption Failed: ",$pgp->errstr; my $a = $ciphertext; print $a;

Comment on generate pgp5 code Crypt::OpenPGP
Select or Download Code
Re: generate pgp5 code Crypt::OpenPGP
by vinoth.ree (Parson) on Jan 29, 2013 at 07:50 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1015675]
Approved by vinoth.ree
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-07-14 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (257 votes), past polls