diff options
author | LRN <lrn1986@gmail.com> | 2013-03-03 01:57:04 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-03-03 01:57:04 +0000 |
commit | 63346db616d6478416ec5686746a7818acf81ed6 (patch) | |
tree | e852f16fb85560b97986b87db09f966f2455664e /src/util | |
parent | 9d1521268727d41c5c9ef30d3568125d6f0ac379 (diff) | |
download | gnunet-63346db616d6478416ec5686746a7818acf81ed6.tar.gz gnunet-63346db616d6478416ec5686746a7818acf81ed6.zip |
Implement and use GNUNET_CRYPTO_rsa_get_public_key_hash
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/crypto_rsa.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index 6857a1221..07eff6696 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c | |||
@@ -195,6 +195,22 @@ GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey | |||
195 | 195 | ||
196 | 196 | ||
197 | /** | 197 | /** |
198 | * Get hash of the public key that corresponds to a private key. | ||
199 | * | ||
200 | * @param key RSA private key | ||
201 | * @param id buffer for hash of the public key | ||
202 | */ | ||
203 | void | ||
204 | GNUNET_CRYPTO_rsa_get_public_key_hash (struct GNUNET_CRYPTO_RsaPrivateKey *key, | ||
205 | struct GNUNET_HashCode *id) | ||
206 | { | ||
207 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded pk; | ||
208 | GNUNET_CRYPTO_rsa_key_get_public (key, &pk); | ||
209 | GNUNET_CRYPTO_hash (&pk, sizeof (pk), id); | ||
210 | } | ||
211 | |||
212 | |||
213 | /** | ||
198 | * Convert a public key to a string. | 214 | * Convert a public key to a string. |
199 | * | 215 | * |
200 | * @param pub key to convert | 216 | * @param pub key to convert |