in reply to Re: Re: Re: Crypt::OpenPGP PassphraseCallback example please
in thread Crypt::OpenPGP PassphraseCallback example please

This is a big help but I have another question. In reading more it looks like PassphraseCallback is used only when you want a user to enter the passphrase. If I wan't to hard code the passphrase into my script shouldn't this code work? Or is Passphrase only used for symetric? When I run it I get the following error

decryption failed: Seckey unlock failed: Bad checksum

$pgp = Crypt::OpenPGP->new ( "SecRing" => 'test.private' )or die Crypt::OpenPGP->errstr; my $plaintext = $pgp->decrypt( "Data" => $crypt, "Passphrase" => 'password' );<br> die "decryption failed: ", $pgp->errstr unless $plaintext; print "PLAINTEXT IS $plaintext\n";


Thanks boat73