Identity management. More...
Data Structures | |
struct | GNUNET_IDENTITY_PrivateKey |
A private key for an identity as per LSD0001. More... | |
struct | GNUNET_IDENTITY_PublicKey |
An identity key as per LSD0001. More... | |
struct | GNUNET_IDENTITY_Signature |
An identity signature as per LSD0001. More... | |
Macros | |
#define | GNUNET_IDENTITY_VERSION 0x00000100 |
Version number of GNUnet Identity API. More... | |
#define | GNUNET_IDENTITY_sign(priv, ps, sig) |
Sign a given block with GNUNET_IDENTITY_PrivateKey. More... | |
#define | GNUNET_IDENTITY_signature_verify(purp, ps, sig, pub) |
Verify a given signature with GNUNET_IDENTITY_PublicKey. More... | |
#define | GNUNET_IDENTITY_ENCRYPT_OVERHEAD_BYTES |
Typedefs | |
typedef void(* | GNUNET_IDENTITY_Callback) (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name) |
Method called to inform about the egos of this peer. More... | |
typedef void(* | GNUNET_IDENTITY_Continuation) (void *cls, enum GNUNET_ErrorCode ec) |
Function called once the requested operation has been completed. More... | |
typedef void(* | GNUNET_IDENTITY_CreateContinuation) (void *cls, const struct GNUNET_IDENTITY_PrivateKey *pk, enum GNUNET_ErrorCode ec) |
Function called once the requested operation has been completed. More... | |
typedef void(* | GNUNET_IDENTITY_EgoCallback) (void *cls, struct GNUNET_IDENTITY_Ego *ego) |
Function called with the result. More... | |
typedef void(* | GNUNET_IDENTITY_EgoSuffixCallback) (void *cls, const struct GNUNET_IDENTITY_PrivateKey *priv, const char *ego_name) |
Function called with the result. More... | |
Enumerations | |
enum | GNUNET_IDENTITY_KeyType { GNUNET_IDENTITY_TYPE_ECDSA = 65536 , GNUNET_IDENTITY_TYPE_EDDSA = 65556 } |
Identity management.
Egos in GNUnet are ECDSA keys. You assume an ego by using (signing with) a particular private key. As GNUnet users are expected to have many egos, we need an identity service to allow users to manage their egos. The identity service manages the egos (private keys) of the local user; it does NOT manage egos of other users (public keys). For giving names to other users and manage their public keys securely, we use GNS.
#define GNUNET_IDENTITY_VERSION 0x00000100 |
Version number of GNUnet Identity API.
Definition at line 63 of file gnunet_identity_service.h.
#define GNUNET_IDENTITY_sign | ( | priv, | |
ps, | |||
sig | |||
) |
Sign a given block with GNUNET_IDENTITY_PrivateKey.
The ps data must be a fixed-size struct for which the signature is to be created. The size
field in ps->purpose must correctly indicate the number of bytes of the data structure, including its header.
priv | private key to use for the signing | |
ps | packed struct with what to sign, MUST begin with a purpose | |
[out] | sig | where to write the signature |
Definition at line 623 of file gnunet_identity_service.h.
#define GNUNET_IDENTITY_signature_verify | ( | purp, | |
ps, | |||
sig, | |||
pub | |||
) |
Verify a given signature with GNUNET_IDENTITY_PublicKey.
The ps data must be a fixed-size struct for which the signature is to be created. The size
field in ps->purpose must correctly indicate the number of bytes of the data structure, including its header.
purp | purpose of the signature, must match 'ps->purpose.purpose' (except in host byte order) |
ps | packed struct with what to sign, MUST begin with a purpose |
sig | where to read the signature from |
pub | public key to use for the verifying |
Definition at line 696 of file gnunet_identity_service.h.
#define GNUNET_IDENTITY_ENCRYPT_OVERHEAD_BYTES |
Definition at line 754 of file gnunet_identity_service.h.
typedef void(* GNUNET_IDENTITY_Callback) (void *cls, struct GNUNET_IDENTITY_Ego *ego, void **ctx, const char *name) |
Method called to inform about the egos of this peer.
When used with GNUNET_IDENTITY_connect, this function is initially called for all egos and then again whenever a ego's name changes or if it is deleted. At the end of the initial pass over all egos, the function is once called with 'NULL' for ego. That does NOT mean that the callback won't be invoked in the future or that there was an error.
When used with GNUNET_IDENTITY_create or GNUNET_IDENTITY_get, this function is only called ONCE, and 'NULL' being passed in ego does indicate an error (for example because name is taken or no default value is known). If ego is non-NULL and if '*ctx' is set in those callbacks, the value WILL be passed to a subsequent call to the identity callback of GNUNET_IDENTITY_connect (if that one was not NULL).
When an identity is renamed, this function is called with the (known) ego but the NEW name.
When an identity is deleted, this function is called with the (known) ego and "NULL" for the name. In this case, the ego is henceforth invalid (and the ctx should also be cleaned up).
cls | closure |
ego | ego handle |
ctx | context for application to store data for this ego (during the lifetime of this process, initially NULL) |
name | name assigned by the user for this ego, NULL if the user just deleted the ego and it must thus no longer be used |
Definition at line 242 of file gnunet_identity_service.h.
typedef void(* GNUNET_IDENTITY_Continuation) (void *cls, enum GNUNET_ErrorCode ec) |
Function called once the requested operation has been completed.
cls | closure |
ec | the GNUNET_ErrorCode |
Definition at line 286 of file gnunet_identity_service.h.
typedef void(* GNUNET_IDENTITY_CreateContinuation) (void *cls, const struct GNUNET_IDENTITY_PrivateKey *pk, enum GNUNET_ErrorCode ec) |
Function called once the requested operation has been completed.
cls | closure |
pk | private key, NULL on error |
ec | the GNUNET_ErrorCode |
Definition at line 326 of file gnunet_identity_service.h.
typedef void(* GNUNET_IDENTITY_EgoCallback) (void *cls, struct GNUNET_IDENTITY_Ego *ego) |
Function called with the result.
cls | closure |
ego | NULL on error / ego not found |
Definition at line 873 of file gnunet_identity_service.h.
typedef void(* GNUNET_IDENTITY_EgoSuffixCallback) (void *cls, const struct GNUNET_IDENTITY_PrivateKey *priv, const char *ego_name) |
Function called with the result.
cls | closure |
ego | NULL on error / ego not found |
ego_name | NULL on error, name of the ego otherwise |
Definition at line 914 of file gnunet_identity_service.h.
Enumerator | |
---|---|
GNUNET_IDENTITY_TYPE_ECDSA | The identity type. The value is the same as the PKEY record type. |
GNUNET_IDENTITY_TYPE_EDDSA | EDDSA identity. The value is the same as the EDKEY record type. |
Definition at line 65 of file gnunet_identity_service.h.
const struct GNUNET_IDENTITY_PrivateKey* GNUNET_IDENTITY_ego_get_private_key | ( | const struct GNUNET_IDENTITY_Ego * | ego | ) |
Obtain the ECC key associated with a ego.
ego | the ego |
Definition at line 560 of file identity_api.c.
References GNUNET_IDENTITY_Ego::pk.
Referenced by add_attribute_cont(), add_credential_cont(), authorize_endpoint(), callback_ego_lookup(), callback_update_ego(), code_redirect(), collect_orphans(), consume_ticket_cont(), delete_attribute_cont(), delete_credential_cont(), directory_trim_complete(), display_record(), ego_callback(), ego_cb(), ego_get_all(), ego_get_response(), get_ego(), get_identity_for_string(), get_srv_handle_ego(), GNUNET_CONVERSATION_phone_create(), handle_gns_response(), id_connect_cb(), identity_cb(), list_attribute_cont(), list_credential_cont(), list_tickets_cont(), namestore_add_or_update(), namestore_delete(), namestore_get(), namestore_import(), origin_lookup_cb(), print_ego(), read_encrypted_message(), remove_did_document_ego_lookup_cb(), revoke_ticket_cont(), sign_cb(), store_cb(), uri_ksk_continuation(), and userinfo_endpoint().
struct GNUNET_IDENTITY_Ego* GNUNET_IDENTITY_ego_get_anonymous | ( | void | ) |
Obtain the ego representing 'anonymous' users.
Definition at line 157 of file identity_api.c.
References GNUNET_IDENTITY_PrivateKey::ecdsa_key, GNUNET_assert, GNUNET_CRYPTO_ecdsa_key_get_anonymous(), GNUNET_CRYPTO_hash(), GNUNET_IDENTITY_private_key_get_length(), GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_IDENTITY_Ego::id, GNUNET_IDENTITY_Ego::pk, GNUNET_IDENTITY_Ego::pub, httpdomain.autohttp.bottle::setup(), GNUNET_IDENTITY_PrivateKey::type, and GNUNET_IDENTITY_PublicKey::type.
Referenced by get_anonymous_public_key(), and get_srv_handle_ego().
void GNUNET_IDENTITY_ego_get_public_key | ( | struct GNUNET_IDENTITY_Ego * | ego, |
struct GNUNET_IDENTITY_PublicKey * | pk | ||
) |
Get the identifier (public key) of an ego.
ego | identity handle with the private key |
pk | set to ego's public key |
Definition at line 573 of file identity_api.c.
References GNUNET_IDENTITY_key_get_public(), GNUNET_NO, GNUNET_YES, pk, GNUNET_IDENTITY_Ego::pk, GNUNET_IDENTITY_Ego::pub, and GNUNET_IDENTITY_Ego::pub_initialized.
Referenced by code_redirect(), consume_ticket_cont(), DID_did_to_pkey(), DID_ego_to_did(), DID_identity_to_did_document(), ego_callback(), find_ego(), get_anonymous_public_key(), get_ego(), get_identity_for_string(), get_srv_handle_ego(), id_connect_cb(), list_ego(), print_ego(), revoke_ticket_cont(), and store_cb().
struct GNUNET_IDENTITY_Handle* GNUNET_IDENTITY_connect | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
GNUNET_IDENTITY_Callback | cb, | ||
void * | cb_cls | ||
) |
Connect to the identity service.
cfg | Configuration to contact the identity service. |
cb | function to call on all identity events, can be NULL |
cb_cls | closure for cb |
cfg | the configuration to use |
cb | function to call on all identity events, can be NULL |
cb_cls | closure for cb |
Definition at line 531 of file identity_api.c.
References GNUNET_IDENTITY_Handle::cb, GNUNET_IDENTITY_Handle::cb_cls, cfg, GNUNET_ARM_Handle::cfg, GNUNET_CONTAINER_multihashmap_create(), GNUNET_free, GNUNET_new, GNUNET_YES, h, GNUNET_ARM_Handle::mq, and reconnect().
Referenced by init_ego_store(), libgnunet_plugin_rest_identity_init(), libgnunet_plugin_rest_namestore_init(), libgnunet_plugin_rest_openid_connect_init(), libgnunet_plugin_rest_reclaim_init(), run(), and run_service().
struct GNUNET_IDENTITY_Operation* GNUNET_IDENTITY_get | ( | struct GNUNET_IDENTITY_Handle * | id, |
const char * | service_name, | ||
GNUNET_IDENTITY_Callback | cb, | ||
void * | cb_cls | ||
) |
Obtain the ego that is currently preferred/default for a service.
id | identity service to query |
service_name | for which service is an identity wanted |
cb | function to call with the result (will only be called once) |
cb_cls | closure for cb |
struct GNUNET_IDENTITY_Operation* GNUNET_IDENTITY_set | ( | struct GNUNET_IDENTITY_Handle * | id, |
const char * | service_name, | ||
struct GNUNET_IDENTITY_Ego * | ego, | ||
GNUNET_IDENTITY_Continuation | cont, | ||
void * | cont_cls | ||
) |
Set the preferred/default ego for a service.
id | identity service to inform |
service_name | for which service is an identity set |
ego | new default identity to be set for this service |
cont | function to call once the operation finished |
cont_cls | closure for cont |
void GNUNET_IDENTITY_disconnect | ( | struct GNUNET_IDENTITY_Handle * | h | ) |
Disconnect from identity service.
h | identity service to disconnect |
h | handle to destroy |
Definition at line 757 of file identity_api.c.
Referenced by cleanup(), clear_ego_store(), do_cleanup(), do_shutdown(), do_stop_task(), libgnunet_plugin_rest_identity_done(), libgnunet_plugin_rest_namestore_done(), libgnunet_plugin_rest_openid_connect_done(), libgnunet_plugin_rest_reclaim_done(), process_stdin(), and shutdown_task().
struct GNUNET_IDENTITY_Operation* GNUNET_IDENTITY_create | ( | struct GNUNET_IDENTITY_Handle * | id, |
const char * | name, | ||
const struct GNUNET_IDENTITY_PrivateKey * | privkey, | ||
enum GNUNET_IDENTITY_KeyType | ktype, | ||
GNUNET_IDENTITY_CreateContinuation | cont, | ||
void * | cont_cls | ||
) |
Create a new ego with the given name.
id | identity service to use |
name | desired name |
privkey | desired private key or NULL to create one |
ktype | the type of key to create. Ignored if privkey != NULL. |
cont | function to call with the result (will only be called once) |
cont_cls | closure for cont |
Definition at line 586 of file identity_api.c.
References env, GNUNET_assert, GNUNET_break, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_IDENTITY_private_key_get_length(), GNUNET_IDENTITY_write_private_key_to_buffer(), GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_IDENTITY_CREATE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, GNUNET_OK, GNUNET_ARM_Operation::h, h, CreateRequestMessage::key_len, GNUNET_ARM_Handle::mq, name, CreateRequestMessage::name_len, op, and private_key_create().
Referenced by create_did_ego_lockup_cb(), create_store_ego(), ego_create(), origin_lookup_cb(), and run().
struct GNUNET_IDENTITY_Operation* GNUNET_IDENTITY_rename | ( | struct GNUNET_IDENTITY_Handle * | h, |
const char * | old_name, | ||
const char * | new_name, | ||
GNUNET_IDENTITY_Continuation | cb, | ||
void * | cb_cls | ||
) |
Renames an existing ego.
id | identity service to use |
old_name | old name |
new_name | desired new name |
cb | function to call with the result (will only be called once) |
cb_cls | closure for cb |
Renames an existing ego.
h | identity service to use |
old_name | old name |
new_name | desired new name |
cb | function to call with the result (will only be called once) |
cb_cls | closure for cb |
Definition at line 646 of file identity_api.c.
References env, GNUNET_break, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_IDENTITY_RENAME, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, GNUNET_ARM_Operation::h, h, GNUNET_ARM_Handle::mq, RenameMessage::new_name_len, RenameMessage::old_name_len, and op.
Referenced by ego_edit(), and rename_store_ego().
struct GNUNET_IDENTITY_Operation* GNUNET_IDENTITY_delete | ( | struct GNUNET_IDENTITY_Handle * | h, |
const char * | name, | ||
GNUNET_IDENTITY_Continuation | cb, | ||
void * | cb_cls | ||
) |
Delete an existing ego.
id | identity service to use |
name | name of the identity to delete |
cb | function to call with the result (will only be called once) |
cb_cls | closure for cb |
Delete an existing ego.
h | identity service to use |
name | name of the identity to delete |
cb | function to call with the result (will only be called once) |
cb_cls | closure for cb |
Definition at line 699 of file identity_api.c.
References env, GNUNET_break, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_MAX_MESSAGE_SIZE, GNUNET_memcpy, GNUNET_MESSAGE_TYPE_IDENTITY_DELETE, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, GNUNET_ARM_Operation::h, h, GNUNET_ARM_Handle::mq, name, DeleteMessage::name_len, op, and DeleteMessage::reserved.
Referenced by ego_delete_name(), ego_delete_pubkey(), renew_store_ego(), and run().
void GNUNET_IDENTITY_cancel | ( | struct GNUNET_IDENTITY_Operation * | op | ) |
Cancel an identity operation.
Note that the operation MAY still be executed; this merely cancels the continuation; if the request was already transmitted, the service may still choose to complete the operation.
op | operation to cancel |
Definition at line 740 of file identity_api.c.
References op.
Referenced by clear_ego_store(), do_shutdown(), and shutdown_task().
ssize_t GNUNET_IDENTITY_public_key_get_length | ( | const struct GNUNET_IDENTITY_PublicKey * | key | ) |
Get the compacted length of a GNUNET_IDENTITY_PublicKey.
Compacted means that it returns the minimum number of bytes this key is long, as opposed to the union structure inside GNUNET_IDENTITY_PublicKey. Useful for compact serializations.
key | the key. |
Definition at line 830 of file identity_api.c.
References GNUNET_break, GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_IDENTITY_TYPE_EDDSA, and key.
Referenced by attr_iter_cb(), change_handle_ego(), check_credential_iteration_start(), check_signature(), consume_result_cb(), ego_callback(), get_message_body_size(), gns_string_to_value(), GNUNET_GNS_lookup_limited(), GNUNET_IDENTITY_public_key_to_string(), GNUNET_IDENTITY_read_private_key_from_buffer(), GNUNET_MESSENGER_send_message(), GNUNET_NAMESTORE_zone_to_name(), GNUNET_RECLAIM_read_ticket_from_buffer(), GNUNET_RECLAIM_ticket_issue(), GNUNET_REVOCATION_proof_get_size(), GNUNET_REVOCATION_query(), handle_client_call_message(), run(), run_edkey(), run_pkey(), run_with_key(), and run_with_zone_pkey().
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_read_public_key_from_buffer | ( | const void * | buffer, |
size_t | len, | ||
struct GNUNET_IDENTITY_PublicKey * | key, | ||
size_t * | read | ||
) |
Reads a GNUNET_IDENTITY_PublicKey from a compact buffer.
The buffer has to contain at least the compacted length of a GNUNET_IDENTITY_PublicKey in bytes. If the buffer is too small, the function returns -1 as error. If the buffer does not contain a valid key, it returns -2 as error.
buffer | the buffer |
len | the length of buffer |
key | the key |
the | amount of bytes read from the buffer |
Definition at line 847 of file identity_api.c.
Referenced by check_get_key(), check_send_message(), do_flood(), handle_attribute_result(), handle_cadet_ring_message(), handle_consume_ticket_result(), handle_credential_result(), handle_get_key(), handle_issue_ticket_message(), handle_lookup(), handle_phone_ring(), handle_send_message(), and handle_zone_to_name().
ssize_t GNUNET_IDENTITY_private_key_get_length | ( | const struct GNUNET_IDENTITY_PrivateKey * | key | ) |
Get the compacted length of a GNUNET_IDENTITY_PrivateKey.
Compacted means that it returns the minimum number of bytes this key is long, as opposed to the union structure inside GNUNET_IDENTITY_PrivateKey. Useful for compact serializations.
key | the key. |
Definition at line 809 of file identity_api.c.
References GNUNET_break, GNUNET_ERROR_TYPE_ERROR, GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_IDENTITY_TYPE_EDDSA, GNUNET_log, and key.
Referenced by check_zone_to_name(), create_update_message(), GNUNET_IDENTITY_create(), GNUNET_IDENTITY_ego_get_anonymous(), GNUNET_IDENTITY_private_key_from_string(), GNUNET_IDENTITY_write_private_key_to_buffer(), GNUNET_NAMESTORE_records_store2(), GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_NAMESTORE_zone_iteration_start2(), GNUNET_NAMESTORE_zone_monitor_start(), GNUNET_NAMESTORE_zone_monitor_start2(), GNUNET_NAMESTORE_zone_to_name(), GNUNET_RECLAIM_attribute_delete(), GNUNET_RECLAIM_attribute_store(), GNUNET_RECLAIM_credential_delete(), GNUNET_RECLAIM_credential_store(), GNUNET_RECLAIM_get_attributes_start(), GNUNET_RECLAIM_get_credentials_start(), GNUNET_RECLAIM_ticket_consume(), GNUNET_RECLAIM_ticket_issue(), GNUNET_RECLAIM_ticket_iteration_start(), GNUNET_RECLAIM_ticket_revoke(), handle_gns_response(), handle_identity_update(), notify_listeners(), records_lookup(), and send_lookup_response_with_filter().
ssize_t GNUNET_IDENTITY_write_public_key_to_buffer | ( | const struct GNUNET_IDENTITY_PublicKey * | key, |
void * | buffer, | ||
size_t | len | ||
) |
Writes a GNUNET_IDENTITY_PublicKey to a compact buffer.
The buffer requires space for at least the compacted length of a GNUNET_IDENTITY_PublicKey in bytes. If the buffer is too small, the function returns -1 as error. If the key is not valid, it returns -2 as error.
key | the key |
buffer | the buffer |
len | the length of buffer |
Definition at line 890 of file identity_api.c.
Referenced by attr_iter_cb(), change_handle_ego(), check_credential_iteration_start(), check_signature(), consume_result_cb(), GNUNET_GNS_lookup_limited(), GNUNET_MESSENGER_send_message(), GNUNET_NAMESTORE_zone_to_name(), GNUNET_RECLAIM_ticket_issue(), GNUNET_RECLAIM_write_ticket_to_buffer(), GNUNET_REVOCATION_query(), and handle_client_call_message().
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_read_private_key_from_buffer | ( | const void * | buffer, |
size_t | len, | ||
struct GNUNET_IDENTITY_PrivateKey * | key, | ||
size_t * | read | ||
) |
Reads a GNUNET_IDENTITY_PrivateKey from a compact buffer.
The buffer has to contain at least the compacted length of a GNUNET_IDENTITY_PrivateKey in bytes. If the buffer is too small, the function returns GNUNET_SYSERR as error.
buffer | the buffer |
len | the length of buffer |
key | the key |
the | amount of bytes read from the buffer |
Definition at line 890 of file identity_api.c.
References GNUNET_IDENTITY_public_key_get_length(), GNUNET_memcpy, key, and len.
Referenced by handle_attribute_delete_message(), handle_attribute_store_message(), handle_client_call_message(), handle_consume_ticket_message(), handle_create_message(), handle_credential_delete_message(), handle_credential_iteration_start(), handle_credential_store_message(), handle_identity_update(), handle_issue_ticket_message(), handle_iteration_start(), handle_lookup_result(), handle_monitor_start(), handle_record_lookup(), handle_record_result(), handle_record_store(), handle_result(), handle_revoke_ticket_message(), handle_ticket_iteration_start(), handle_zone_to_name(), and handle_zone_to_name_response().
ssize_t GNUNET_IDENTITY_write_private_key_to_buffer | ( | const struct GNUNET_IDENTITY_PrivateKey * | key, |
void * | buffer, | ||
size_t | len | ||
) |
Writes a GNUNET_IDENTITY_PrivateKey to a compact buffer.
The buffer requires space for at least the compacted length of a GNUNET_IDENTITY_PrivateKey in bytes. If the buffer is too small, the function returns -1 as error. If the key is not valid, it returns -2 as error.
key | the key |
buffer | the buffer |
len | the length of buffer |
Definition at line 933 of file identity_api.c.
References GNUNET_IDENTITY_private_key_get_length(), GNUNET_memcpy, key, and len.
Referenced by check_zone_to_name(), create_update_message(), GNUNET_IDENTITY_create(), GNUNET_NAMESTORE_records_store2(), GNUNET_NAMESTORE_zone_iteration_start(), GNUNET_NAMESTORE_zone_iteration_start2(), GNUNET_NAMESTORE_zone_to_name(), GNUNET_RECLAIM_attribute_delete(), GNUNET_RECLAIM_attribute_store(), GNUNET_RECLAIM_credential_delete(), GNUNET_RECLAIM_credential_store(), GNUNET_RECLAIM_get_attributes_start(), GNUNET_RECLAIM_get_credentials_start(), GNUNET_RECLAIM_ticket_consume(), GNUNET_RECLAIM_ticket_issue(), GNUNET_RECLAIM_ticket_iteration_start(), GNUNET_RECLAIM_ticket_revoke(), handle_gns_response(), notify_listeners(), reconnect(), records_lookup(), and send_lookup_response_with_filter().
ssize_t GNUNET_IDENTITY_signature_get_length | ( | const struct GNUNET_IDENTITY_Signature * | sig | ) |
Get the compacted length of a GNUNET_IDENTITY_Signature.
Compacted means that it returns the minimum number of bytes this signature is long, as opposed to the union structure inside GNUNET_IDENTITY_Signature. Useful for compact serializations.
sig | the signature. |
Definition at line 951 of file identity_api.c.
References GNUNET_IDENTITY_Signature::ecdsa_signature, GNUNET_IDENTITY_Signature::eddsa_signature, GNUNET_break, GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_IDENTITY_TYPE_EDDSA, and GNUNET_IDENTITY_Signature::type.
Referenced by get_message_size(), GNUNET_IDENTITY_read_signature_from_buffer(), GNUNET_IDENTITY_sign_(), handle_client_call_message(), and hash_message().
ssize_t GNUNET_IDENTITY_signature_get_raw_length_by_type | ( | uint32_t | type | ) |
Get the compacted length of a signature by type.
Compacted means that it returns the minimum number of bytes this signature is long, as opposed to the union structure inside GNUNET_IDENTITY_Signature. Useful for compact serializations.
sig | the signature. |
Definition at line 970 of file identity_api.c.
References GNUNET_break, GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_IDENTITY_TYPE_EDDSA, and type.
Referenced by GNUNET_REVOCATION_proof_get_size().
ssize_t GNUNET_IDENTITY_read_signature_from_buffer | ( | struct GNUNET_IDENTITY_Signature * | sig, |
const void * | buffer, | ||
size_t | len | ||
) |
Reads a GNUNET_IDENTITY_Signature from a compact buffer.
The buffer has to contain at least the compacted length of a GNUNET_IDENTITY_Signature in bytes. If the buffer is too small, the function returns -1 as error. If the buffer does not contain a valid key, it returns -2 as error.
sig | the signature |
buffer | the buffer |
len | the length of buffer |
Definition at line 988 of file identity_api.c.
References GNUNET_IDENTITY_Signature::ecdsa_signature, GNUNET_IDENTITY_signature_get_length(), GNUNET_memcpy, len, and GNUNET_IDENTITY_Signature::type.
Referenced by decode_message(), and handle_cadet_ring_message().
ssize_t GNUNET_IDENTITY_write_signature_to_buffer | ( | const struct GNUNET_IDENTITY_Signature * | sig, |
void * | buffer, | ||
size_t | len | ||
) |
Writes a GNUNET_IDENTITY_Signature to a compact buffer.
The buffer requires space for at least the compacted length of a GNUNET_IDENTITY_Signature in bytes. If the buffer is too small, the function returns -1 as error. If the key is not valid, it returns -2 as error.
sig | the signature |
buffer | the buffer |
len | the length of buffer |
Definition at line 1008 of file identity_api.c.
Referenced by handle_client_call_message().
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_sign_ | ( | const struct GNUNET_IDENTITY_PrivateKey * | priv, |
const struct GNUNET_CRYPTO_EccSignaturePurpose * | purpose, | ||
struct GNUNET_IDENTITY_Signature * | sig | ||
) |
Sign a given block.
The purpose data is the beginning of the data of which the signature is to be created. The size
field in purpose must correctly indicate the number of bytes of the data structure, including its header. If possible, use GNUNET_IDENTITY_sign() instead of this function.
priv | private key to use for the signing | |
purpose | what to sign (size, purpose) | |
[out] | sig | where to write the signature |
Definition at line 1008 of file identity_api.c.
References GNUNET_IDENTITY_Signature::ecdsa_signature, GNUNET_IDENTITY_signature_get_length(), GNUNET_memcpy, len, and GNUNET_IDENTITY_Signature::type.
Referenced by check_code_challenge(), and GNUNET_ABD_delegate_issue().
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_sign_raw_ | ( | const struct GNUNET_IDENTITY_PrivateKey * | priv, |
const struct GNUNET_CRYPTO_EccSignaturePurpose * | purpose, | ||
unsigned char * | sig | ||
) |
Sign a given block.
The purpose data is the beginning of the data of which the signature is to be created. The size
field in purpose must correctly indicate the number of bytes of the data structure, including its header. The signature payload and length depends on the key type.
priv | private key to use for the signing | |
purpose | what to sign (size, purpose) | |
[out] | sig | where to write the signature |
Definition at line 1008 of file identity_api.c.
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_signature_verify_ | ( | uint32_t | purpose, |
const struct GNUNET_CRYPTO_EccSignaturePurpose * | validate, | ||
const struct GNUNET_IDENTITY_Signature * | sig, | ||
const struct GNUNET_IDENTITY_PublicKey * | pub | ||
) |
Verify a given signature.
The validate data is the beginning of the data of which the signature is to be verified. The size
field in validate must correctly indicate the number of bytes of the data structure, including its header. If purpose does not match the purpose given in validate (the latter must be in big endian), signature verification fails. If possible, use GNUNET_IDENTITY_signature_verify() instead of this function (only if validate is not fixed-size, you must use this function directly).
purpose | what is the purpose that the signature should have? |
validate | block to validate (size, purpose, data) |
sig | signature that is being validated |
pub | public key of the signer |
Definition at line 1008 of file identity_api.c.
Referenced by GNUNET_ABD_delegate_deserialize(), GNUNET_ABD_delegate_serialize(), and OIDC_parse_authz_code().
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_signature_verify_raw_ | ( | uint32_t | purpose, |
const struct GNUNET_CRYPTO_EccSignaturePurpose * | validate, | ||
const unsigned char * | sig, | ||
const struct GNUNET_IDENTITY_PublicKey * | pub | ||
) |
Verify a given signature.
The validate data is the beginning of the data of which the signature is to be verified. The size
field in validate must correctly indicate the number of bytes of the data structure, including its header. If purpose does not match the purpose given in validate (the latter must be in big endian), signature verification fails.
purpose | what is the purpose that the signature should have? |
validate | block to validate (size, purpose, data) |
sig | signature that is being validated |
pub | public key of the signer |
Definition at line 1008 of file identity_api.c.
ssize_t GNUNET_IDENTITY_encrypt_old | ( | const void * | block, |
size_t | size, | ||
const struct GNUNET_IDENTITY_PublicKey * | pub, | ||
struct GNUNET_CRYPTO_EcdhePublicKey * | ecc, | ||
void * | result | ||
) |
Encrypt a block with GNUNET_IDENTITY_PublicKey and derives a GNUNET_CRYPTO_EcdhePublicKey which is required for decryption using ecdh to derive a symmetric key.
block | the block to encrypt |
size | the size of the block |
pub | public key to use for ecdh |
ecc | where to write the ecc public key |
result | the output parameter in which to store the encrypted result can be the same or overlap with block |
len
. Definition at line 1139 of file identity_api.c.
ssize_t GNUNET_IDENTITY_decrypt_old | ( | const void * | block, |
size_t | size, | ||
const struct GNUNET_IDENTITY_PrivateKey * | priv, | ||
const struct GNUNET_CRYPTO_EcdhePublicKey * | ecc, | ||
void * | result | ||
) |
Decrypt a given block with GNUNET_IDENTITY_PrivateKey and a given GNUNET_CRYPTO_EcdhePublicKey using ecdh to derive a symmetric key.
block | the data to decrypt, encoded as returned by encrypt |
size | the size of the block to decrypt |
priv | private key to use for ecdh |
ecc | the ecc public key |
result | address to store the result at can be the same or overlap with block |
size
. Definition at line 1275 of file identity_api.c.
References GNUNET_IDENTITY_PrivateKey::ecdsa_key, GNUNET_IDENTITY_PrivateKey::eddsa_key, GNUNET_CRYPTO_ecdsa_ecdh(), GNUNET_CRYPTO_eddsa_ecdh(), GNUNET_CRYPTO_hash_to_aes_key(), GNUNET_CRYPTO_symmetric_decrypt(), GNUNET_CRYPTO_zero_keys(), GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_IDENTITY_TYPE_EDDSA, GNUNET_SYSERR, key, result, size, and GNUNET_IDENTITY_PrivateKey::type.
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_encrypt | ( | const void * | block, |
size_t | size, | ||
const struct GNUNET_IDENTITY_PublicKey * | pub, | ||
void * | result, | ||
size_t | result_size | ||
) |
Encrypt a block with GNUNET_IDENTITY_PublicKey and derives a GNUNET_CRYPTO_EcdhePublicKey which is required for decryption using ecdh to derive a symmetric key.
Note that the result buffer for the ciphertext must be the length of the message to encrypt plus GNUNET_IDENTITY_ENCRYPT_OVERHEAD_BYTES.
block | the block to encrypt |
size | the size of the block |
pub | public key to encrypt for |
result | the output parameter in which to store the encrypted result can be the same or overlap with block |
Definition at line 1139 of file identity_api.c.
Referenced by encrypt_message(), and write_encrypted_message().
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_decrypt | ( | const void * | block, |
size_t | size, | ||
const struct GNUNET_IDENTITY_PrivateKey * | priv, | ||
void * | result, | ||
size_t | result_size | ||
) |
Decrypt a given block with GNUNET_IDENTITY_PrivateKey and a given GNUNET_CRYPTO_EcdhePublicKey using ecdh to derive a symmetric key.
block | the data to decrypt, encoded as returned by encrypt |
size | the size of the block to decrypt |
priv | private key to use for ecdh |
result | address to store the result at can be the same or overlap with block |
Definition at line 1139 of file identity_api.c.
References GNUNET_CRYPTO_ecdh_ecdsa(), GNUNET_CRYPTO_ecdh_eddsa(), GNUNET_CRYPTO_ecdhe_key_clear(), GNUNET_CRYPTO_ecdhe_key_create(), GNUNET_CRYPTO_ecdhe_key_get_public(), GNUNET_CRYPTO_hash_to_aes_key(), GNUNET_CRYPTO_symmetric_encrypt(), GNUNET_CRYPTO_zero_keys(), GNUNET_IDENTITY_TYPE_ECDSA, GNUNET_IDENTITY_TYPE_EDDSA, GNUNET_SYSERR, key, pk, pub, result, and size.
Referenced by decrypt_message(), and read_encrypted_message().
char* GNUNET_IDENTITY_public_key_to_string | ( | const struct GNUNET_IDENTITY_PublicKey * | key | ) |
Creates a (Base32) string representation of the public key.
The resulting string encodes a compacted representation of the key. See also #GNUNET_IDENTITY_key_get_length.
key | the key. |
Definition at line 1310 of file identity_api.c.
References GNUNET_IDENTITY_public_key_get_length(), GNUNET_STRINGS_data_to_string_alloc(), key, and size.
Referenced by abd_value_to_string(), create_finished(), delegation_chain_fw_resolution_start(), DID_ego_to_did(), DID_pkey_to_did(), forward_resolution(), get_store_contact(), gns_value_to_string(), GNUNET_ABD_delegate_to_string(), GNUNET_GNSRECORD_pkey_to_zkey(), handle_get_key(), handle_intermediate_result(), handle_verify_result(), issue_ticket(), list_ego(), print_deleset(), print_ego(), RECLAIM_TICKETS_consume(), and store_cb().
char* GNUNET_IDENTITY_private_key_to_string | ( | const struct GNUNET_IDENTITY_PrivateKey * | key | ) |
Creates a (Base32) string representation of the private key.
The resulting string encodes a compacted representation of the key. See also #GNUNET_IDENTITY_key_get_length.
key | the key. |
Definition at line 1320 of file identity_api.c.
Referenced by create_finished(), display_record(), ego_get_all(), ego_get_response(), and print_ego().
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_public_key_from_string | ( | const char * | str, |
struct GNUNET_IDENTITY_PublicKey * | key | ||
) |
Parses a (Base32) string representation of the public key.
See also GNUNET_IDENTITY_public_key_to_string.
str | the encoded key. |
key | where to write the key. |
Definition at line 1320 of file identity_api.c.
Referenced by abd_string_to_value(), authorize_endpoint(), code_redirect(), create_response(), get_identity_for_string(), gns_string_to_value(), GNUNET_ABD_delegate_from_string(), GNUNET_GNS_lookup_with_tld(), GNUNET_GNSRECORD_data_from_identity(), identity_cb(), load_member_session(), load_member_session_next(), run(), run_with_zone_pkey(), sign_cb(), start_process(), tld_iter(), and write_encrypted_message().
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_private_key_from_string | ( | const char * | str, |
struct GNUNET_IDENTITY_PrivateKey * | key | ||
) |
Parses a (Base32) string representation of the private key.
See also GNUNET_IDENTITY_private_key_to_string.
str | the encoded key. |
key | where to write the key. |
Definition at line 1320 of file identity_api.c.
References GNUNET_IDENTITY_private_key_get_length(), GNUNET_STRINGS_data_to_string_alloc(), key, and size.
enum GNUNET_GenericReturnValue GNUNET_IDENTITY_key_get_public | ( | const struct GNUNET_IDENTITY_PrivateKey * | privkey, |
struct GNUNET_IDENTITY_PublicKey * | key | ||
) |
Retrieves the public key representation of a private key.
privkey | the private key. |
key | the public key result. |
Definition at line 157 of file identity_api.c.
Referenced by attr_iter_cb(), authorize_endpoint(), block_create2(), check_credential_iteration_start(), create_finished(), create_message_key(), DID_create(), filter_tickets_finished_cb(), get_nick_record(), GNUNET_ABD_delegate_issue(), GNUNET_GNSRECORD_query_from_private_key(), GNUNET_IDENTITY_ego_get_public_key(), handle_attribute_store_message(), handle_client_call_message(), handle_collect(), handle_credential_store_message(), identity_zone_cb(), issue_ticket(), RECLAIM_TICKETS_consume(), RECLAIM_TICKETS_revoke(), run_edkey(), run_pkey(), run_with_key(), and update_store_ego().
struct GNUNET_IDENTITY_EgoLookup* GNUNET_IDENTITY_ego_lookup | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | name, | ||
GNUNET_IDENTITY_EgoCallback | cb, | ||
void * | cb_cls | ||
) |
Lookup an ego by name.
cfg | configuration to use |
name | name to look up |
cb | callback to invoke with the result |
cb_cls | closure for cb |
Definition at line 186 of file identity_api_lookup.c.
References GNUNET_IDENTITY_EgoLookup::cb, GNUNET_IDENTITY_EgoLookup::cb_cls, cfg, el, env, GNUNET_assert, GNUNET_break, GNUNET_CLIENT_connect(), GNUNET_free, GNUNET_MESSAGE_TYPE_IDENTITY_LOOKUP, GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE, GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, GNUNET_strdup, handlers, GNUNET_IDENTITY_EgoLookup::mq, mq_error_handler(), name, and GNUNET_IDENTITY_EgoLookup::name.
Referenced by add_continuation(), create_did(), create_did_ego_create_cb(), ego_sign_data(), lookup_store_ego(), parse(), remove_did_document(), replace_did_document_remove_cb(), and run().
void GNUNET_IDENTITY_ego_lookup_cancel | ( | struct GNUNET_IDENTITY_EgoLookup * | el | ) |
Abort ego lookup attempt.
el | handle for lookup to abort |
Definition at line 236 of file identity_api_lookup.c.
References el, GNUNET_free, GNUNET_MQ_destroy(), GNUNET_IDENTITY_EgoLookup::mq, and GNUNET_IDENTITY_EgoLookup::name.
Referenced by clear_ego_store(), do_shutdown(), handle_identity_result_code(), and handle_identity_update().
struct GNUNET_IDENTITY_EgoSuffixLookup* GNUNET_IDENTITY_ego_lookup_by_suffix | ( | const struct GNUNET_CONFIGURATION_Handle * | cfg, |
const char * | suffix, | ||
GNUNET_IDENTITY_EgoSuffixCallback | cb, | ||
void * | cb_cls | ||
) |
Obtain the ego with the maximum suffix match between the ego's name and the given domain name suffix.
For example, given a suffix "a.b.c" and egos with names "d.a.b.c", "b.c" and "c", we return the ego for "b.c".
cfg | configuration to use |
suffix | for which domain name suffix is an identity wanted |
cb | function to call with the result (will only be called once) |
cb_cls | closure for cb |
Obtain the ego with the maximum suffix match between the ego's name and the given domain name suffix.
cfg | configuration to use |
name | name to look up |
cb | callback to invoke with the result |
cb_cls | closure for cb |
Definition at line 185 of file identity_api_suffix_lookup.c.
References GNUNET_IDENTITY_EgoLookup::cb, GNUNET_IDENTITY_EgoLookup::cb_cls, cfg, el, env, GNUNET_assert, GNUNET_break, GNUNET_CLIENT_connect(), GNUNET_free, GNUNET_MESSAGE_TYPE_IDENTITY_LOOKUP_BY_SUFFIX, GNUNET_MESSAGE_TYPE_IDENTITY_RESULT_CODE, GNUNET_MESSAGE_TYPE_IDENTITY_UPDATE, GNUNET_MQ_handler_end, GNUNET_MQ_hd_var_size, GNUNET_MQ_msg_extra, GNUNET_MQ_send(), GNUNET_new, GNUNET_strdup, handlers, GNUNET_IDENTITY_EgoLookup::mq, and mq_error_handler().
Referenced by GNUNET_GNS_lookup_with_tld().
void GNUNET_IDENTITY_ego_lookup_by_suffix_cancel | ( | struct GNUNET_IDENTITY_EgoSuffixLookup * | el | ) |
Abort ego suffix lookup attempt.
el | handle for lookup to abort |
Abort ego suffix lookup attempt.
el | handle for lookup to abort |
Definition at line 237 of file identity_api_suffix_lookup.c.
References el, GNUNET_free, GNUNET_MQ_destroy(), and GNUNET_IDENTITY_EgoLookup::mq.
Referenced by GNUNET_GNS_lookup_with_tld_cancel(), handle_identity_result_code(), handle_identity_update(), and mq_error_handler().