Honoured monks residing in this holy place, I have a question about Crypt::OpenPGP.
I have generated a private and public key with Crypt::OpenPGP->keygen. However, when I try to use this key with OpenPGP->sign I get the following error:
PARI: *** unexpected character:
^-
I wish I could get more information about what is failing here but that is all I can squeeze out of it.. I know that the KeyId is correct or else it would have told me this, I also know that passphrase is correct.
It is also worth mentioning that I can encrypt a file without any problems, which leads me to believe that my keys are working correctly.
If any of you esteemed monks have any information that could send me in the right direction I would be very grateful.
use Crypt::OpenPGP;
my $pgp = Crypt::OpenPGP->new(
SecRing => "private.keyring",
PubRing => "public.key"
);
my $data = "Please sign me... PLZ";
my $signature = $pgp->sign(
Data => $data,
KeyID => "775B1EE7CB2F10CD",
Passphrase => "XXXXXXXX",
Detach => 1,
Clearsign => 1
) or die "Could not sign. Got error: $pgp->errstr";
print $signature;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.