Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 (Prior) 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 meditating upon the Monastery: (6)
As of 2015-07-04 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls