Re: [openssl-users] Hashing public keys

2018-03-21 Thread Dr. Pala
Hi Jan, not sure if this might help you, I solved the problem by using X509_PUBKEY + i2d_X509_PUBKEY. Here's an example:     https://github.com/openca/libpki/blob/b87b647170cb5f71e00baffe609f5a02edfa3845/src/openssl/pki_keypair.c#L307 I hope that helps, Cheers, Max On 3/21/18 1:42 PM, Jan Dan

Re: [openssl-users] Hashing public keys

2018-03-21 Thread Dr. Matthias St. Pierre
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 EVP_DigestInit()/EVP_DigestUpdate()/EVP_DigestFinal(). Hope that helps, Matthias Am 21.03.2018 um 14:42 schrieb Jan D

Re: [openssl-users] Hashing public keys in EVP_PKEY's

2014-12-11 Thread Viktor Dukhovni
On Thu, Dec 11, 2014 at 04:02:10PM +0100, Jan Danielsson wrote: >If I would want to use the hash of a EVP_PKEY to uniquely identify > the key (regardless of whether it contains the private key or not), what > would be the best way to do this? (I.e. how do I deterministically hash > the public