[tor-dev] PKCS#1 ASN.1 Public Key Encoding

Gareth Owen gareth.owen at port.ac.uk
Sun Aug 17 15:19:56 UTC 2014

Hi all

I wonder if someone might be able to help me with the above.  I understand,
that to generate the digest, the PK must be encoded in PKCS#1 format.  And
further to this, the public keys in the router descriptors are NOT in
PKCS#1 format, but plain ASN.1.

I'm trying to generate the fingerprint given just the pubilc key in Java
and after almost a whole day I'm about to give up.  Does anyone have a
sample PKCS#1 encoded public key that is used immediately before SHA-1 to
generate the fingerprint?  e.g. a hex string is what I'm after.

It seems there are subtle ways that an PKCS#1 can vary while encoding the
same information which affects the hash, Java seems to be doing it one way,
OpenSSL another, an example on stack overflow adds an extra field, etc.

Many thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20140817/78ae3d3f/attachment-0001.html>

More information about the tor-dev mailing list