diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_hello_lib.h | 37 | ||||
-rw-r--r-- | src/include/gnunet_signatures.h | 6 |
2 files changed, 43 insertions, 0 deletions
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index 2a961e524..e19419f25 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h | |||
@@ -473,6 +473,43 @@ GNUNET_HELLO_parse_uri (const char *uri, | |||
473 | GNUNET_HELLO_TransportPluginsFind plugins_find); | 473 | GNUNET_HELLO_TransportPluginsFind plugins_find); |
474 | 474 | ||
475 | 475 | ||
476 | |||
477 | /* NG API */ | ||
478 | |||
479 | /** | ||
480 | * Build address record by signing raw information with private key. | ||
481 | * | ||
482 | * @param address text address to sign | ||
483 | * @param expiration how long is @a address valid | ||
484 | * @param private_key signing key to use | ||
485 | * @param result[out] where to write address record (allocated) | ||
486 | * @param result_size[out] set to size of @a result | ||
487 | */ | ||
488 | void | ||
489 | GNUNET_HELLO_sign_address (const char *address, | ||
490 | struct GNUNET_TIME_Absolute expiration, | ||
491 | const struct GNUNET_CRYPTO_EddsaPrivateKey *private_key, | ||
492 | void **result, | ||
493 | size_t *result_size); | ||
494 | |||
495 | |||
496 | /** | ||
497 | * Check signature and extract address record. | ||
498 | * | ||
499 | * @param raw raw signed address | ||
500 | * @param raw_size size of @a raw | ||
501 | * @param public_key public key to use for signature verification | ||
502 | * @param expiration[out] how long is the address valid | ||
503 | * @return NULL on error, otherwise the address | ||
504 | */ | ||
505 | char * | ||
506 | GNUNET_HELLO_extract_address (const void *raw, | ||
507 | size_t raw_size, | ||
508 | const struct GNUNET_CRYPTO_EddsaPublicKey *public_key, | ||
509 | struct GNUNET_TIME_Absolute *expiration); | ||
510 | |||
511 | |||
512 | |||
476 | #if 0 /* keep Emacsens' auto-indent happy */ | 513 | #if 0 /* keep Emacsens' auto-indent happy */ |
477 | { | 514 | { |
478 | #endif | 515 | #endif |
diff --git a/src/include/gnunet_signatures.h b/src/include/gnunet_signatures.h index 829f8be7e..03c97f199 100644 --- a/src/include/gnunet_signatures.h +++ b/src/include/gnunet_signatures.h | |||
@@ -188,6 +188,12 @@ extern "C" | |||
188 | */ | 188 | */ |
189 | #define GNUNET_SIGNATURE_PURPOSE_CREDENTIAL 28 | 189 | #define GNUNET_SIGNATURE_PURPOSE_CREDENTIAL 28 |
190 | 190 | ||
191 | /** | ||
192 | * Signature by a peer affirming that this is one of its | ||
193 | * addresses (for the given time period). | ||
194 | */ | ||
195 | #define GNUNET_SIGNATURE_PURPOSE_TRANSPORT_ADDRESS 29 | ||
196 | |||
191 | #if 0 /* keep Emacsens' auto-indent happy */ | 197 | #if 0 /* keep Emacsens' auto-indent happy */ |
192 | { | 198 | { |
193 | #endif | 199 | #endif |