|
libpcp
0.2.1
|
Uthashes of secret and public key structures. More...
Macros | |
| #define | pcphash_iterate(key) |
| Iterate over the list of secret keys. | |
| #define | pcphash_iteratepub(key) |
| Iterate over the list of public keys. | |
Functions | |
| void | pcphash_init () |
| Initialize the global hashes. | |
| void | pcphash_del (void *key, int type) |
| Delete an entry from a hash. | |
| void | pcphash_clean () |
| Frees the memory allocated by the hashes. | |
| pcp_key_t * | pcphash_keyexists (char *id) |
| Check if a secret key with a given key-id exists in the hash. | |
| pcp_pubkey_t * | pcphash_pubkeyexists (char *id) |
| Check if a publickey with a given key-id exists in the hash. | |
| void | pcphash_add (void *key, int type) |
| Add a key structure to the hash list. | |
| int | pcphash_count () |
| Returns the number of secret keys in the hash. | |
| int | pcphash_countpub () |
| Returns the number of public keys in the hash. | |
Variables | |
| pcp_key_t * | pcpkey_hash |
| Global hash for secret keys. | |
| pcp_pubkey_t * | pcppubkey_hash |
| Global hash for public keys. | |
| pcp_keysig_t * | pcpkeysig_hash |
| Global hash for key signatures. | |
Uthashes of secret and public key structures.
Libpcp uses the uthash system to maintain lists of keys. There's one hash per key type. The hash has the same type as the key structure itself, but is global.
| #define pcphash_iterate | ( | key | ) |
Iterate over the list of secret keys.
Sample use:
Also, don't free() the keyhash or the temporary key pointer yourself. Use pcphash_clean() instead when done.
| #define pcphash_iteratepub | ( | key | ) |
Iterate over the list of public keys.
Sample use:
Also, don't free() the keyhash or the temporary key pointer yourself. Use pcphash_clean() instead when done.
| void pcphash_add | ( | void * | key, |
| int | type | ||
| ) |
Add a key structure to the hash list.
| [in] | key | A pointer to the key structure to delete. |
| [in] | type | An integer specifying the key type to delete. |
| void pcphash_clean | ( | ) |
Frees the memory allocated by the hashes.
Clears and frees memory of all keys in the hash lists and the hashes themselfes.
| int pcphash_count | ( | ) |
Returns the number of secret keys in the hash.
| int pcphash_countpub | ( | ) |
Returns the number of public keys in the hash.
| void pcphash_del | ( | void * | key, |
| int | type | ||
| ) |
Delete an entry from a hash.
| [in] | key | A pointer to the key structure to delete. |
| [in] | type | An integer specifying the key type to delete. |
| void pcphash_init | ( | ) |
Initialize the global hashes.
| pcp_key_t* pcphash_keyexists | ( | char * | id | ) |
Check if a secret key with a given key-id exists in the hash.
| [in] | id | A string with the key-id (max 17 chars incl 0). |
| pcp_pubkey_t* pcphash_pubkeyexists | ( | char * | id | ) |
Check if a publickey with a given key-id exists in the hash.
| [in] | id | A string with the key-id (max 17 chars incl 0). |
| pcp_key_t* pcpkey_hash |
Global hash for secret keys.
| pcp_keysig_t* pcpkeysig_hash |
Global hash for key signatures.
| pcp_pubkey_t* pcppubkey_hash |
Global hash for public keys.
1.8.2