Hi, looking at a post by Sisyphus on comp.lang.perl. misc, it seems that you CAN use the numeric keys, like you tried in your
original post. He showed a neat trick ( which I will have to explore further) where he reblessed the key data, and it works.
This brings up alot more possiblities where you might be able to remove the priv_key , and write it in PEM, so as to distribute the key?
#!/usr/bin/perl
use Crypt::DSA;
my $dsa = Crypt::DSA->new;
# my $key = $dsa->keygen(Size => 512, Verbosity => 1);
# print ref $key; foreach my $k (keys %{$key}) {
# print $k . "=" . $key->$k . " ";
# }
my %key;
# Note: keys shortened for display
$key{"priv_key"} = ........86791024560681741810216";
$key{"p"} = .........7985558533404147484885008958544
$key{"g"} = ........1562731546589267205891649491991
$key{"q"} = .......97436093010198645746872403487";
# $key{"pub_key"} = ......5081267508071818636049670044
# don't need pub_key for signing
my $sig_msg = "xxxxxxxxxxxxxxxxxx\n" x 40;
my $k = \%key;
bless($k, "Crypt::DSA::Key");
$sig = $dsa->sign(Message=>$sig_msg, Key => $k);
I'm not really a human, but I play one on earth.
flash japh
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.