OpenDNSSEC-signer  2.1.10
keys.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009 NLNet Labs. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
14  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
17  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
19  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
21  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
22  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
23  * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  *
25  */
26 
27 #ifndef SIGNER_KEYS_H
28 #define SIGNER_KEYS_H
29 
30 #ifdef HAVE_SYS_TYPES_H
31 # include <sys/types.h>
32 #endif
33 #ifdef HAVE_UNISTD_H
34 # include <unistd.h>
35 #endif
36 #include <ldns/ldns.h>
37 
38 typedef struct key_struct key_type;
39 typedef struct keylist_struct keylist_type;
40 
41 #include "status.h"
42 #include "libhsm.h"
43 #include "libhsmdns.h"
44 #include "signconf.h"
45 
50 struct key_struct {
51  ldns_rr* dnskey;
52  hsm_sign_params_t* params;
53  const char* locator;
54  const char* resourcerecord;
55  uint8_t algorithm;
56  uint32_t flags;
57  int publish;
58  int ksk;
59  int zsk;
60 };
61 
69  size_t count;
70 };
71 
79 
87 extern key_type* keylist_lookup_by_locator(keylist_type* kl, const char* locator);
88 
101 extern key_type* keylist_push(keylist_type* kl, const char* locator, const char* resourcerecord,
102  uint8_t algorithm, uint32_t flags, int publish, int ksk, int zsk);
103 
110 extern void keylist_log(keylist_type* kl, const char* name);
111 
117 extern void keylist_cleanup(keylist_type* kl);
118 
126 key_type* key_recover2(FILE* fd, keylist_type* kl);
127 
135 void keylist_backup(FILE* fd, keylist_type* kl, const char* version);
136 
137 #endif /* SIGNER_KEYS_H */
keylist_type * keylist_create(signconf_type *sc)
Definition: keys.c:48
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
void keylist_log(keylist_type *kl, const char *name)
Definition: keys.c:147
key_type * keylist_lookup_by_locator(keylist_type *kl, const char *locator)
Definition: keys.c:73
void keylist_cleanup(keylist_type *kl)
Definition: keys.c:183
void keylist_backup(FILE *fd, keylist_type *kl, const char *version)
Definition: keys.c:268
key_type * key_recover2(FILE *fd, keylist_type *kl)
Definition: keys.c:223
ldns_rr * dnskey
Definition: keys.h:51
const char * resourcerecord
Definition: keys.h:54
uint8_t algorithm
Definition: keys.h:55
int ksk
Definition: keys.h:58
const char * locator
Definition: keys.h:53
hsm_sign_params_t * params
Definition: keys.h:52
int publish
Definition: keys.h:57
uint32_t flags
Definition: keys.h:56
int zsk
Definition: keys.h:59
size_t count
Definition: keys.h:69
signconf_type * sc
Definition: keys.h:67
key_type * keys
Definition: keys.h:68