[openssl-users] Hashing public keys

Dr. Matthias St. Pierre Matthias.St.Pierre at ncp-e.com
Wed Mar 21 20:33:03 UTC 2018

Hello Jan,

the canonical way to create the hash of the public key is to use
d2i_PUBKEY() to save the public key in (binary) DER format and then
calculate the hash of that using

Hope that helps,


Am 21.03.2018 um 14:42 schrieb Jan Danielsson:
> Hello,
>    Given an EVP_PKEY (can contain either RSA or EC key), is there a
> function to generate a hash of the public key?  (I have some vague
> memory of having read a few years ago that there wasn't any standardized
> way to hashing EC keys (+parameters) yet.  If so; has this been remedied?).
>    (Storing public keys in a DHT, users need to be able to - given a
> public key - generate a hash to check if the hash exists in the DHT).

More information about the openssl-users mailing list