OpenDNSSEC-signer 1.2.1
Data Structures | Typedefs | Functions

/build/buildd-opendnssec_1.2.1.dfsg-1-ia64-j6OroR/opendnssec-1.2.1.dfsg/signer/src/signer/se_key.h File Reference

#include <ldns/ldns.h>
#include <libhsm.h>
#include <libhsmdns.h>
Include dependency graph for se_key.h:

Go to the source code of this file.

Data Structures

struct  key_struct
struct  keylist_struct

Typedefs

typedef struct key_struct key_type
typedef struct keylist_struct keylist_type

Functions

key_typekey_create (const char *locator, uint8_t algorithm, uint32_t flags, int publish, int ksk, int zsk)
key_typekey_recover_from_backup (FILE *fd)
void key_cleanup (key_type *key)
void key_print (FILE *out, key_type *key)
keylist_typekeylist_create (void)
int keylist_add (keylist_type *kl, key_type *key)
int key_compare (key_type *a, key_type *b)
key_typekeylist_lookup (keylist_type *kl, const char *locator)
int keylist_delete (keylist_type *kl, key_type *key)
int keylist_compare (keylist_type *a, keylist_type *b)
void keylist_cleanup (keylist_type *kl)
void keylist_print (FILE *out, keylist_type *kl)

Typedef Documentation

typedef struct key_struct key_type

Signing keys. Key.

Definition at line 51 of file se_key.h.

typedef struct keylist_struct keylist_type

Key list.

Definition at line 69 of file se_key.h.


Function Documentation

void key_cleanup ( key_type key)

Clean up key.

Parameters:
[in]keycleaun up this key

Clean up key.

Definition at line 128 of file se_key.c.

References key_struct::dnskey, key_struct::hsmkey, key_cleanup(), key_struct::locator, key_struct::next, key_struct::params, se_free(), and se_log_warning().

Referenced by key_cleanup(), and keylist_cleanup().

int key_compare ( key_type a,
key_type b 
)

Compare two key references.

Parameters:
[in]aone key
[in]banother key
Returns:
0 on equal, -1 if a a < b, 1 if a > b.

Compare two key references.

Definition at line 237 of file se_key.c.

References key_struct::locator, se_log_assert, and se_strcmp().

Referenced by keylist_compare(), and keylist_delete().

key_type* key_create ( const char *  locator,
uint8_t  algorithm,
uint32_t  flags,
int  publish,
int  ksk,
int  zsk 
)

Create a new key.

Parameters:
[in]locatorstring that identifies location of key
[in]algorithmDNSKEY algorithm field value
[in]flagsDNSKEY flags field value
[in]publishif true, publish key as a DNSKEY
[in]kskif true, sign DNSKEY RRset with this key
[in]zskif true, sign all but DNSKEY RRset with this key
Returns:
key_type* key

Signing keys. Create a new key.

Definition at line 46 of file se_key.c.

References key_struct::algorithm, key_struct::dnskey, key_struct::flags, key_struct::hsmkey, key_struct::ksk, key_struct::locator, key_struct::next, key_struct::params, key_struct::publish, se_log_assert, se_malloc(), se_strdup(), and key_struct::zsk.

Referenced by parse_sc_keys().

void key_print ( FILE *  out,
key_type key 
)

Print key.

Parameters:
[in]outfile descriptor
[in]keyprint this key

Print key.

Definition at line 163 of file se_key.c.

References key_struct::algorithm, key_struct::flags, key_struct::ksk, key_struct::locator, key_struct::publish, se_log_assert, and key_struct::zsk.

Referenced by keylist_print().

key_type* key_recover_from_backup ( FILE *  fd)
int keylist_add ( keylist_type kl,
key_type key 
)

Add a key to the keylist.

Parameters:
[in]klkey list
[in]keykey
Returns:
int 0 on success, 1 on error

Add a key to the keylist.

Definition at line 210 of file se_key.c.

References keylist_struct::count, keylist_struct::first_key, key_struct::locator, key_struct::next, se_log_assert, and se_log_debug().

Referenced by parse_sc_keys().

void keylist_cleanup ( keylist_type kl)

Clean up key list.

Parameters:
[in]klkey list to clean up

Clean up key list.

Definition at line 376 of file se_key.c.

References keylist_struct::first_key, key_cleanup(), se_free(), se_log_debug(), and se_log_warning().

Referenced by signconf_cleanup().

int keylist_compare ( keylist_type a,
keylist_type b 
)

Compare two key lists.

Parameters:
[in]aone key list
[in]banother key list
Returns:
0 on equal, -1 if a a < b, 1 if a > b.

Compare two key lists.

Definition at line 314 of file se_key.c.

References key_struct::algorithm, keylist_struct::count, keylist_struct::first_key, key_struct::flags, key_compare(), key_struct::ksk, key_struct::next, key_struct::publish, se_log_assert, se_log_warning(), and key_struct::zsk.

Referenced by signconf_compare().

keylist_type* keylist_create ( void  )

Create a new key list.

Returns:
keylist_type* key list

Create a new key list.

Definition at line 194 of file se_key.c.

References keylist_struct::count, keylist_struct::first_key, se_log_debug(), and se_malloc().

Referenced by parse_sc_keys(), and zone_recover_from_backup().

int keylist_delete ( keylist_type kl,
key_type key 
)

Delete a key from the keylist.

Parameters:
[in]klkey list
[in]keykey
Returns:
int 0 on success, 1 on error

Delete a key from the keylist.

Definition at line 250 of file se_key.c.

References keylist_struct::count, keylist_struct::first_key, key_compare(), key_struct::locator, key_struct::next, se_log_assert, se_log_debug(), and se_log_error().

key_type* keylist_lookup ( keylist_type list,
const char *  locator 
)

Lookup a key in the key list by locator.

Parameters:
[in]klkey list
[in]locatorkey locator
Returns:
key_type* key if it exists, NULL otherwise

Lookup a key in the key list by locator.

Definition at line 285 of file se_key.c.

References keylist_struct::count, keylist_struct::first_key, key_struct::locator, key_struct::next, and se_strcmp().

void keylist_print ( FILE *  out,
keylist_type kl 
)

Print key list.

Parameters:
[in]outfile descriptor
[in]klkey list to print

Print key list.

Definition at line 395 of file se_key.c.

References keylist_struct::first_key, key_print(), key_struct::next, and se_log_assert.

Referenced by signconf_print().