Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

keys.h File Reference

Go to the source code of this file.

Data Structures

struct  ldns_struct_key
 general key structure, can contain all types of keys More...
struct  ldns_struct_key_list
 same as rr_list, but now for keys More...

Defines

#define LDNS_KEY_ZONE_KEY   0x0100
#define LDNS_KEY_SEP_KEY   0x0001

Typedefs

typedef ldns_struct_key ldns_key
typedef ldns_struct_key_list ldns_key_list

Enumerations

enum  ldns_enum_algorithm {
  LDNS_RSAMD5 = 1, LDNS_DH = 2, LDNS_DSA = 3, LDNS_ECC = 4,
  LDNS_RSASHA1 = 5, LDNS_INDIRECT = 252, LDNS_PRIVATEDNS = 253, LDNS_PRIVATEOID = 254
}
 algorithms used in dns More...
enum  ldns_enum_signing_algorithm { LDNS_SIGN_RSAMD5 = LDNS_RSAMD5, LDNS_SIGN_RSASHA1 = LDNS_RSASHA1, LDNS_SIGN_DSA = LDNS_DSA, LDNS_SIGN_HMACMD5 = 150 }
 algorithms used in dns for signing More...

Functions

ldns_key_listldns_key_list_new ()
 creates a new empty key list
ldns_keyldns_key_new ()
 creates a new empty key structure
ldns_keyldns_key_new_frm_algorithm (ldns_signing_algorithm a, uint16_t size)
 creates a new key based on the algorithm
ldns_keyldns_key_new_frm_fp (FILE *fp)
 creates a new priv key based on the contents of the file pointed by fp
ldns_keyldns_key_new_frm_fp_l (FILE *fp, int *line_nr)
 creates a new priv key based on the contents of the file pointed by fp
RSA * ldns_key_new_frm_fp_rsa (FILE *fp)
 frm_fp helper function.
RSA * ldns_key_new_frm_fp_rsa_l (FILE *fp, int *line_nr)
 frm_fp helper function.
DSA * ldns_key_new_frm_fp_dsa (FILE *fp)
 frm_fp helper function.
DSA * ldns_key_new_frm_fp_dsa_l (FILE *fp, int *line_nr)
 frm_fp helper function.
void ldns_key_set_algorithm (ldns_key *k, ldns_signing_algorithm l)
void ldns_key_set_rsa_key (ldns_key *k, RSA *r)
void ldns_key_set_dsa_key (ldns_key *k, DSA *d)
void ldns_key_set_hmac_key (ldns_key *k, unsigned char *hmac)
void ldns_key_set_origttl (ldns_key *k, uint32_t t)
void ldns_key_set_inception (ldns_key *k, uint32_t i)
void ldns_key_set_expiration (ldns_key *k, uint32_t e)
void ldns_key_set_pubkey_owner (ldns_key *k, ldns_rdf *r)
void ldns_key_set_keytag (ldns_key *k, uint16_t tag)
void ldns_key_set_flags (ldns_key *k, uint16_t flags)
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)
 pushes a key to a keylist
size_t ldns_key_list_key_count (ldns_key_list *key_list)
 returns the number of keys in the key list
ldns_keyldns_key_list_key (ldns_key_list *key, size_t nr)
 returns a pointer to the key in the list at the given position
RSA * ldns_key_rsa_key (ldns_key *k)
 returns the (openssl) RSA struct contained in the key
DSA * ldns_key_dsa_key (ldns_key *k)
 returns the (openssl) DSA struct contained in the key
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)
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_rdfldns_key_pubkey_owner (ldns_key *k)
uint16_t ldns_key_flags (ldns_key *k)
ldns_keyldns_key_list_pop_key (ldns_key_list *key_list)
 pops the last rr from a keylist
ldns_rrldns_key2rr (ldns_key *k)
 converts a ldns_key to a public key rr
void ldns_key_print (FILE *output, ldns_key *k)
 print a private key to the file ouput
void ldns_key_free (ldns_key *key)
 frees a key structure
void ldns_key_deep_free (ldns_key *key)
 frees a key structure and all it's internal data
void ldns_key_list_free (ldns_key_list *key_list)
 Frees a key list structure.

Variables

ldns_lookup_table ldns_signing_algorithms []


Define Documentation

#define LDNS_KEY_SEP_KEY   0x0001
 

Definition at line 24 of file keys.h.

#define LDNS_KEY_ZONE_KEY   0x0100
 

Definition at line 23 of file keys.h.


Typedef Documentation

typedef struct ldns_struct_key ldns_key
 

Definition at line 77 of file keys.h.

typedef struct ldns_struct_key_list ldns_key_list
 

Definition at line 87 of file keys.h.


Enumeration Type Documentation

enum ldns_enum_algorithm
 

algorithms used in dns

Enumeration values:
LDNS_RSAMD5 
LDNS_DH 
LDNS_DSA 
LDNS_ECC 
LDNS_RSASHA1 
LDNS_INDIRECT 
LDNS_PRIVATEDNS 
LDNS_PRIVATEOID 

Definition at line 29 of file keys.h.

enum ldns_enum_signing_algorithm
 

algorithms used in dns for signing

Enumeration values:
LDNS_SIGN_RSAMD5 
LDNS_SIGN_RSASHA1 
LDNS_SIGN_DSA 
LDNS_SIGN_HMACMD5 

Definition at line 45 of file keys.h.


Function Documentation

ldns_rr* ldns_key2rr ldns_key k  ) 
 

converts a ldns_key to a public key rr

Parameters:
[in] k the ldns_key to convert
Returns:
ldns_rr representation of the key

ldns_signing_algorithm ldns_key_algorithm ldns_key k  ) 
 

void ldns_key_deep_free ldns_key key  ) 
 

frees a key structure and all it's internal data

Parameters:
[in] key the key object to free

DSA* ldns_key_dsa_key ldns_key k  ) 
 

returns the (openssl) DSA struct contained in the key

uint32_t ldns_key_expiration ldns_key k  ) 
 

uint16_t ldns_key_flags ldns_key k  ) 
 

void ldns_key_free ldns_key key  ) 
 

frees a key structure

Parameters:
[in] key the key object to free

unsigned char* ldns_key_hmac_key ldns_key k  ) 
 

uint32_t ldns_key_inception ldns_key k  ) 
 

uint16_t ldns_key_keytag ldns_key k  ) 
 

void ldns_key_list_free ldns_key_list key_list  ) 
 

Frees a key list structure.

Parameters:
[in] key_list the key list object to free

ldns_key* ldns_key_list_key ldns_key_list key,
size_t  nr
 

returns a pointer to the key in the list at the given position

size_t ldns_key_list_key_count ldns_key_list key_list  ) 
 

returns the number of keys in the key list

ldns_key_list* ldns_key_list_new  ) 
 

creates a new empty key list

ldns_key* ldns_key_list_pop_key ldns_key_list key_list  ) 
 

pops the last rr from a keylist

Parameters:
[in] key_list the rr_list to pop from
Returns:
NULL if nothing to pop. Otherwise the popped RR

bool ldns_key_list_push_key ldns_key_list key_list,
ldns_key key
 

pushes a key to a keylist

Parameters:
[in] key_list the key_list to push to
[in] key the key to push
Returns:
false on error, otherwise true

void ldns_key_list_set_key_count ldns_key_list key,
size_t  count
 

ldns_key* ldns_key_new  ) 
 

creates a new empty key structure

ldns_key* ldns_key_new_frm_algorithm ldns_signing_algorithm  a,
uint16_t  size
 

creates a new key based on the algorithm

Parameters:
[in] a The algorithm to use
[in] size the number of bytes for the keysize
Returns:
a new ldns_key structure with the key

ldns_key* ldns_key_new_frm_fp FILE *  fp  ) 
 

creates a new priv key based on the contents of the file pointed by fp

Parameters:
[in] fp the file pointer to use
Returns:
a new ldns_key structure with the key

DSA* ldns_key_new_frm_fp_dsa FILE *  fp  ) 
 

frm_fp helper function.

This function parsed the remainder of the (DSA) priv. key file generated from bind9

Parameters:
[in] fp the file to parse
Returns:
NULL on failure otherwise a RSA structure

DSA* ldns_key_new_frm_fp_dsa_l FILE *  fp,
int *  line_nr
 

frm_fp helper function.

This function parsed the remainder of the (DSA) priv. key file generated from bind9

Parameters:
[in] fp the file to parse
[in] line_nr pointer to an integer containing the current line number (for debugging purposes)
Returns:
NULL on failure otherwise a RSA structure

ldns_key* ldns_key_new_frm_fp_l FILE *  fp,
int *  line_nr
 

creates a new priv key based on the contents of the file pointed by fp

Parameters:
[in] fp the file pointer to use
[in] line_nr pointer to an integer containing the current line number (for debugging purposes)
Returns:
a new ldns_key structure with the key

RSA* ldns_key_new_frm_fp_rsa FILE *  fp  ) 
 

frm_fp helper function.

This function parsed the remainder of the (RSA) priv. key file generated from bind9

Parameters:
[in] fp the file to parse
Returns:
NULL on failure otherwise a RSA structure

RSA* ldns_key_new_frm_fp_rsa_l FILE *  fp,
int *  line_nr
 

frm_fp helper function.

This function parsed the remainder of the (RSA) priv. key file generated from bind9

Parameters:
[in] fp the file to parse
[in] line_nr pointer to an integer containing the current line number (for debugging purposes)
Returns:
NULL on failure otherwise a RSA structure

uint32_t ldns_key_origttl ldns_key k  ) 
 

void ldns_key_print FILE *  output,
ldns_key k
 

print a private key to the file ouput

Parameters:
[in] output the FILE descriptor where to print to
[in] k the ldns_key to print

ldns_rdf* ldns_key_pubkey_owner ldns_key k  ) 
 

RSA* ldns_key_rsa_key ldns_key k  ) 
 

returns the (openssl) RSA struct contained in the key

void ldns_key_set_algorithm ldns_key k,
ldns_signing_algorithm  l
 

void ldns_key_set_dsa_key ldns_key k,
DSA *  d
 

void ldns_key_set_expiration ldns_key k,
uint32_t  e
 

void ldns_key_set_flags ldns_key k,
uint16_t  flags
 

void ldns_key_set_hmac_key ldns_key k,
unsigned char *  hmac
 

void ldns_key_set_inception ldns_key k,
uint32_t  i
 

void ldns_key_set_keytag ldns_key k,
uint16_t  tag
 

void ldns_key_set_origttl ldns_key k,
uint32_t  t
 

void ldns_key_set_pubkey_owner ldns_key k,
ldns_rdf r
 

void ldns_key_set_rsa_key ldns_key k,
RSA *  r
 


Variable Documentation

ldns_lookup_table ldns_signing_algorithms[]
 


Generated on Wed Jan 25 08:46:59 2006 for ldns by  doxygen 1.3.9.1