xref: /netbsd-src/external/mpl/bind/dist/bin/confgen/keygen.h (revision 4b004442778f1201b2161e87fd65ba87aae6601a)
1 /*	$NetBSD: keygen.h,v 1.6 2022/09/23 12:15:20 christos Exp $	*/
2 
3 /*
4  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5  *
6  * SPDX-License-Identifier: MPL-2.0
7  *
8  * This Source Code Form is subject to the terms of the Mozilla Public
9  * License, v. 2.0. If a copy of the MPL was not distributed with this
10  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
11  *
12  * See the COPYRIGHT file distributed with this work for additional
13  * information regarding copyright ownership.
14  */
15 
16 #ifndef RNDC_KEYGEN_H
17 #define RNDC_KEYGEN_H 1
18 
19 /*! \file */
20 
21 #include <isc/buffer.h>
22 #include <isc/lang.h>
23 #include <isc/mem.h>
24 
25 #include <dns/secalg.h>
26 
27 ISC_LANG_BEGINDECLS
28 
29 void
30 generate_key(isc_mem_t *mctx, dns_secalg_t alg, int keysize,
31 	     isc_buffer_t *key_txtbuffer);
32 
33 void
34 write_key_file(const char *keyfile, const char *user, const char *keyname,
35 	       isc_buffer_t *secret, dns_secalg_t alg);
36 
37 const char *
38 alg_totext(dns_secalg_t alg);
39 dns_secalg_t
40 alg_fromtext(const char *name);
41 int
42 alg_bits(dns_secalg_t alg);
43 
44 ISC_LANG_ENDDECLS
45 
46 #endif /* RNDC_KEYGEN_H */
47