[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



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
Gareth
_______________________________________________
tor-dev mailing list
tor-dev@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev