From: Jelte Jansen Date: Thu, 28 Apr 2005 12:01:06 +0000 (+0000) Subject: keys doxed X-Git-Tag: release-0.50~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4359daf496aa1783ae53b51d4e61efef08ac98d;p=thirdparty%2Fldns.git keys doxed --- diff --git a/doc/function_manpages b/doc/function_manpages index af294acb..5a0cf84f 100644 --- a/doc/function_manpages +++ b/doc/function_manpages @@ -29,6 +29,17 @@ ldns_verify, ldns_verify_rrsig, ldns_verify_rrsig_dsa, ldns_verify_rrsig_rsasha1 # key conv ldns_key_buf2dsa, ldns_key_buf2rsa, ldns_key_rr2ds +# dnskey.h +ldns_key_new, ldns_key_new_frm_algorithm, ldns_key2rr, + +# lists +ldns_key_list_new, ldns_key_list_push_key, ldns_key_list_pop_key, ldns_key_list_key_count, ldns_key_list_key +ldns_key_rsa_key, ldns_key_dsa_key, ldns_key_algorithm, ldns_key_hmac_key + +# gets/sets +ldns_key_origttl, ldns_key_inception, ldns_key_expiration, ldns_key_keytag, ldns_key_pubkey_owner, ldns_key_flags +ldns_key_set_algorithm, ldns_key_set_rsa_key, ldns_key_set_dsa_key, ldns_key_set_hmac_key, ldns_key_set_origttl, ldns_key_set_inception, ldns_key_set_expiration, ldns_key_set_pubkey_owner, ldns_key_set_keytag, ldns_key_set_flags, ldns_key_list_set_key_count, + # TSIG ldns_pkt_tsig_verify, ldns_pkt_tsig_sign diff --git a/ldns/keys.h b/ldns/keys.h index bc781e7a..dd391c8b 100644 --- a/ldns/keys.h +++ b/ldns/keys.h @@ -85,15 +85,21 @@ struct ldns_struct_key_list typedef struct ldns_struct_key_list ldns_key_list; -/* creator functions */ +/** + * creates a new empty key list + */ ldns_key_list *ldns_key_list_new(); + +/** + * creates a new empty key structure + */ ldns_key *ldns_key_new(); /** - * Generates a new key based on the algorithm + * creates a new key based on the algorithm * * \param[in] a The algorithm to use - * \param[in] size + * \param[in] size the number of bytes for the keysize */ ldns_key *ldns_key_new_frm_algorithm(ldns_signing_algorithm a, uint16_t size); @@ -118,11 +124,26 @@ void ldns_key_list_set_key_count(ldns_key_list *key, size_t count); */ bool ldns_key_list_push_key(ldns_key_list *key_list, ldns_key *key); -/* access read functions */ +/** + * returns the number of keys in the key list + */ size_t ldns_key_list_key_count(ldns_key_list *key_list); + +/** + * returns a pointer to the key in the list at the given position + */ ldns_key *ldns_key_list_key(ldns_key_list *key, size_t nr); + +/** + * returns the (openssl) RSA struct contained in the key + */ RSA *ldns_key_rsa_key(ldns_key *k); + +/** + * returns the (openssl) DSA struct contained in the key + */ DSA *ldns_key_dsa_key(ldns_key *k); + ldns_signing_algorithm ldns_key_algorithm(ldns_key *k); unsigned char *ldns_key_hmac_key(ldns_key *k); uint32_t ldns_key_origttl(ldns_key *k); @@ -130,21 +151,25 @@ uint32_t ldns_key_inception(ldns_key *k); uint32_t ldns_key_expiration(ldns_key *k); uint16_t ldns_key_keytag(ldns_key *k); ldns_rdf *ldns_key_pubkey_owner(ldns_key *k); +uint16_t ldns_key_flags(ldns_key *k); + +/** + * returns the hmac data contained in the key + */ /** - * Pops the last rr from a keylist + * pops the last rr from a keylist * \param[in] key_list the rr_list to pop from * \return NULL if nothing to pop. Otherwise the popped RR */ ldns_key *ldns_key_list_pop_key(ldns_key_list *key_list); /** - * convert a ldns_key to a public key rr + * converts a ldns_key to a public key rr * * \param[in] k the ldns_key to convert * \return ldns_rr representation of the key */ ldns_rr *ldns_key2rr(ldns_key *k); -uint16_t ldns_key_flags(ldns_key *k); #endif /* _LDNS_KEYS_H */