1 /* 2 * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 3 * 4 * This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. 7 * 8 * See the COPYRIGHT file distributed with this work for additional 9 * information regarding copyright ownership. 10 */ 11 12 #ifndef DNS_CERT_H 13 #define DNS_CERT_H 1 14 15 /*! \file dns/cert.h */ 16 17 #include <isc/lang.h> 18 19 #include <dns/types.h> 20 21 ISC_LANG_BEGINDECLS 22 23 isc_result_t 24 dns_cert_fromtext(dns_cert_t *certp, isc_textregion_t *source); 25 /*%< 26 * Convert the text 'source' refers to into a certificate type. 27 * The text may contain either a mnemonic type name or a decimal type number. 28 * 29 * Requires: 30 *\li 'certp' is a valid pointer. 31 * 32 *\li 'source' is a valid text region. 33 * 34 * Returns: 35 *\li #ISC_R_SUCCESS on success 36 *\li #ISC_R_RANGE numeric type is out of range 37 *\li #DNS_R_UNKNOWN mnemonic type is unknown 38 */ 39 40 isc_result_t 41 dns_cert_totext(dns_cert_t cert, isc_buffer_t *target); 42 /*%< 43 * Put a textual representation of certificate type 'cert' into 'target'. 44 * 45 * Requires: 46 *\li 'cert' is a valid cert. 47 * 48 *\li 'target' is a valid text buffer. 49 * 50 * Ensures: 51 *\li If the result is success: 52 * The used space in 'target' is updated. 53 * 54 * Returns: 55 *\li #ISC_R_SUCCESS on success 56 *\li #ISC_R_NOSPACE target buffer is too small 57 */ 58 59 ISC_LANG_ENDDECLS 60 61 #endif /* DNS_CERT_H */ 62