00001 /* 00002 * Copyright (C) 2004-2007, 2010, 2012, 2014 Internet Systems Consortium, Inc. ("ISC") 00003 * Copyright (C) 2002 Internet Software Consortium. 00004 * 00005 * Permission to use, copy, modify, and/or distribute this software for any 00006 * purpose with or without fee is hereby granted, provided that the above 00007 * copyright notice and this permission notice appear in all copies. 00008 * 00009 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH 00010 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 00011 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, 00012 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 00013 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE 00014 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 00015 * PERFORMANCE OF THIS SOFTWARE. 00016 */ 00017 00018 /* $Id: ds.h,v 1.12 2010/12/23 23:47:08 tbox Exp $ */ 00019 00020 #ifndef DNS_DS_H 00021 #define DNS_DS_H 1 00022 00023 #include <isc/lang.h> 00024 00025 #include <dns/types.h> 00026 00027 #define DNS_DSDIGEST_SHA1 (1) 00028 #define DNS_DSDIGEST_SHA256 (2) 00029 #define DNS_DSDIGEST_GOST (3) 00030 #define DNS_DSDIGEST_SHA384 (4) 00031 00032 /* 00033 * Assuming SHA-384 digest type. 00034 */ 00035 #define DNS_DS_BUFFERSIZE (52) 00036 00037 ISC_LANG_BEGINDECLS 00038 00039 isc_result_t 00040 dns_ds_buildrdata(dns_name_t *owner, dns_rdata_t *key, 00041 unsigned int digest_type, unsigned char *buffer, 00042 dns_rdata_t *rdata); 00043 /*%< 00044 * Build the rdata of a DS record. 00045 * 00046 * Requires: 00047 *\li key Points to a valid DNS KEY record. 00048 *\li buffer Points to a temporary buffer of at least 00049 * #DNS_DS_BUFFERSIZE bytes. 00050 *\li rdata Points to an initialized dns_rdata_t. 00051 * 00052 * Ensures: 00053 * \li *rdata Contains a valid DS rdata. The 'data' member refers 00054 * to 'buffer'. 00055 */ 00056 00057 ISC_LANG_ENDDECLS 00058 00059 #endif /* DNS_DS_H */