Now I remember why I linked Crypt OpenPGP Brain twister, its a Short, Self Contained, Correct Example, in otherwords, more effective :)
If you modify Crypt-OpenPGP-1.06\t\12-sign.t at the first verify call, you can see that this is to be expected
my( $signer , $sigobj ) = $pgp->verify( Signature => $sig );
use DDS; die Dump( [ $key_id , $sigobj->key_id, unpack('H*', $sigo
+bj->key_id ) , pack('H*',$key_id) ] );
$ARRAY1 = [
'39F560A90D7F1559',
"9\365`\251\r\177\25Y",
'39f560a90d7f1559',
"9\365`\251\r\177\25Y"
];
I don't know if keyid is supposed to be 8 or 10 or 16, but the round trip with pack seems to work , so key_id is correct, and the hex representation is correct
AFAIK printf would actually try to convert it, which might overflow as in
$ perl -le " print 0x39f560a90d7f1559
Integer overflow in hexadecimal number at -e line 1.
4.17635050864817e+018
Maybe this is the private key, and you're looking for the public key? Maybe it depends on algorithm? :)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.