keys.h
Go to the documentation of this file.
/*
* Copyright (c) 2009 NLNet Labs. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
#ifndef SIGNER_KEYS_H
#define SIGNER_KEYS_H
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include <ldns/ldns.h>
typedef struct key_struct key_type;
typedef struct keylist_struct keylist_type;
#include "status.h"
#include "libhsm.h"
#include "libhsmdns.h"
#include "signconf.h"
struct key_struct {
ldns_rr* dnskey;
hsm_sign_params_t* params;
const char* locator;
const char* resourcerecord;
uint8_t algorithm;
uint32_t flags;
int publish;
int ksk;
int zsk;
};
struct keylist_struct {
signconf_type* sc;
key_type* keys;
size_t count;
};
extern keylist_type* keylist_create(signconf_type* sc);
extern key_type* keylist_lookup_by_locator(keylist_type* kl, const char* locator);
extern key_type* keylist_push(keylist_type* kl, const char* locator, const char* resourcerecord,
uint8_t algorithm, uint32_t flags, int publish, int ksk, int zsk);
extern void keylist_log(keylist_type* kl, const char* name);
extern void keylist_cleanup(keylist_type* kl);
key_type* key_recover2(FILE* fd, keylist_type* kl);
void keylist_backup(FILE* fd, keylist_type* kl, const char* version);
#endif /* SIGNER_KEYS_H */
key_recover2
key_type * key_recover2(FILE *fd, keylist_type *kl)
Definition keys.c:223
keylist_push
key_type * keylist_push(keylist_type *kl, const char *locator, const char *resourcerecord, uint8_t algorithm, uint32_t flags, int publish, int ksk, int zsk)
Definition keys.c:95
keylist_lookup_by_locator
key_type * keylist_lookup_by_locator(keylist_type *kl, const char *locator)
Definition keys.c:73
keylist_log
void keylist_log(keylist_type *kl, const char *name)
Definition keys.c:147
keylist_cleanup
void keylist_cleanup(keylist_type *kl)
Definition keys.c:183
keylist_backup
void keylist_backup(FILE *fd, keylist_type *kl, const char *version)
Definition keys.c:268
keylist_create
keylist_type * keylist_create(signconf_type *sc)
Definition keys.c:48
signconf.h
key_struct
Definition keys.h:50
key_struct::dnskey
ldns_rr * dnskey
Definition keys.h:51
key_struct::resourcerecord
const char * resourcerecord
Definition keys.h:54
key_struct::algorithm
uint8_t algorithm
Definition keys.h:55
key_struct::ksk
int ksk
Definition keys.h:58
key_struct::locator
const char * locator
Definition keys.h:53
key_struct::params
hsm_sign_params_t * params
Definition keys.h:52
key_struct::publish
int publish
Definition keys.h:57
key_struct::flags
uint32_t flags
Definition keys.h:56
key_struct::zsk
int zsk
Definition keys.h:59
keylist_struct
Definition keys.h:66
keylist_struct::count
size_t count
Definition keys.h:69
keylist_struct::sc
signconf_type * sc
Definition keys.h:67
keylist_struct::keys
key_type * keys
Definition keys.h:68
signconf_struct
Definition signconf.h:41