1 /* $NetBSD: ds.h,v 1.6 2014/12/10 04:37:58 christos Exp $ */ 2 3 /* 4 * Copyright (C) 2004-2007, 2010, 2012, 2014 Internet Systems Consortium, Inc. ("ISC") 5 * Copyright (C) 2002 Internet Software Consortium. 6 * 7 * Permission to use, copy, modify, and/or distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 13 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17 * PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 /* Id: ds.h,v 1.12 2010/12/23 23:47:08 tbox Exp */ 21 22 #ifndef DNS_DS_H 23 #define DNS_DS_H 1 24 25 #include <isc/lang.h> 26 27 #include <dns/types.h> 28 29 #define DNS_DSDIGEST_SHA1 (1) 30 #define DNS_DSDIGEST_SHA256 (2) 31 #define DNS_DSDIGEST_GOST (3) 32 #define DNS_DSDIGEST_SHA384 (4) 33 34 /* 35 * Assuming SHA-384 digest type. 36 */ 37 #define DNS_DS_BUFFERSIZE (52) 38 39 ISC_LANG_BEGINDECLS 40 41 isc_result_t 42 dns_ds_buildrdata(dns_name_t *owner, dns_rdata_t *key, 43 unsigned int digest_type, unsigned char *buffer, 44 dns_rdata_t *rdata); 45 /*%< 46 * Build the rdata of a DS record. 47 * 48 * Requires: 49 *\li key Points to a valid DNS KEY record. 50 *\li buffer Points to a temporary buffer of at least 51 * #DNS_DS_BUFFERSIZE bytes. 52 *\li rdata Points to an initialized dns_rdata_t. 53 * 54 * Ensures: 55 * \li *rdata Contains a valid DS rdata. The 'data' member refers 56 * to 'buffer'. 57 */ 58 59 ISC_LANG_ENDDECLS 60 61 #endif /* DNS_DS_H */ 62