OpenDNSSEC-signer  1.3.9
Data Structures | Typedefs | Functions
keys.h File Reference
#include "shared/allocator.h"
#include "shared/status.h"
#include <ldns/ldns.h>
#include <libhsm.h>
#include <libhsmdns.h>
Include dependency graph for keys.h:
This graph shows which files directly or indirectly include this file:

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 (allocator_type *allocator, const char *locator, uint8_t algorithm, uint32_t flags, int publish, int ksk, int zsk)
 
key_typekey_recover (FILE *fd, allocator_type *allocator)
 
keylist_typekeylist_create (allocator_type *allocator)
 
ods_status keylist_push (keylist_type *kl, key_type *key)
 
key_typekeylist_lookup (keylist_type *kl, const char *locator)
 
key_typekeylist_lookup_by_dnskey (keylist_type *kl, ldns_rr *dnskey)
 
void keylist_cleanup (keylist_type *kl)
 
void keylist_print (FILE *fd, keylist_type *kl)
 
void keylist_backup (FILE *fd, keylist_type *kl)
 
void keylist_log (keylist_type *kl, const char *name)
 

Typedef Documentation

typedef struct key_struct key_type

Signing keys. Key.

Definition at line 55 of file keys.h.

typedef struct keylist_struct keylist_type

Key list.

Definition at line 74 of file keys.h.

Function Documentation

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

Create a new key.

Parameters
[in]allocatormemory allocator
[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

Create a new key.

Definition at line 49 of file keys.c.

References key_struct::algorithm, key_struct::allocator, allocator_alloc(), allocator_strdup(), key_struct::dnskey, key_struct::flags, key_struct::hsmkey, key_struct::ksk, key_struct::locator, key_struct::next, ods_log_assert, ods_log_error(), key_struct::params, key_struct::publish, and key_struct::zsk.

Referenced by parse_sc_keys().

key_type* key_recover ( FILE *  fd,
allocator_type allocator 
)
void keylist_backup ( FILE *  fd,
keylist_type kl 
)

Backup key list.

Parameters
[in]fdfile descriptor
[in]klkey list to print

Backup key list.

Definition at line 408 of file keys.c.

References keylist_struct::first_key, and key_struct::next.

Referenced by zone_backup().

void keylist_cleanup ( keylist_type kl)

Clean up key list.

Parameters
[in]klkey list to clean up

Clean up key list.

Definition at line 482 of file keys.c.

References keylist_struct::allocator, allocator_deallocate(), keylist_struct::first_key, and key_struct::next.

Referenced by signconf_cleanup().

keylist_type* keylist_create ( allocator_type allocator)

Create a new key list.

Parameters
[in]allocatormemory allocator
Returns
keylist_type* key list

Create a new key list.

Definition at line 268 of file keys.c.

References keylist_struct::allocator, allocator_alloc(), keylist_struct::count, keylist_struct::first_key, ods_log_assert, and ods_log_error().

Referenced by parse_sc_keys(), and zone_recover().

void keylist_log ( keylist_type kl,
const char *  name 
)

Log key list.

Parameters
[in]klkey list to print
[in]namezone name

Log key list.

Definition at line 431 of file keys.c.

References keylist_struct::first_key, and key_struct::next.

Referenced by signconf_log().

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 330 of file keys.c.

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

Referenced by parse_sc_keys(), and signconf_compare_keys().

key_type* keylist_lookup_by_dnskey ( keylist_type list,
ldns_rr *  dnskey 
)

Lookup a key in the key list by dnskey.

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

Lookup a key in the key list by dnskey.

Definition at line 359 of file keys.c.

References keylist_struct::count, key_struct::dnskey, keylist_struct::first_key, and key_struct::next.

Referenced by rrset_diff().

void keylist_print ( FILE *  fd,
keylist_type kl 
)

Print key list.

Parameters
[in]fdfile descriptor
[in]klkey list to print

Print key list.

Definition at line 388 of file keys.c.

References keylist_struct::first_key, and key_struct::next.

Referenced by signconf_print().

ods_status keylist_push ( keylist_type kl,
key_type key 
)

Push a key to the keylist.

Parameters
[in]klkey list
[in]keykey
Returns
ods_status status

Push a key to the key list.

Definition at line 299 of file keys.c.

References keylist_struct::count, keylist_struct::first_key, key_struct::locator, key_struct::next, ods_log_assert, ods_log_debug(), ods_log_error(), ODS_STATUS_ASSERT_ERR, and ODS_STATUS_OK.

Referenced by parse_sc_keys(), and zone_recover().