Kea 2.7.5
|
Represents a TSIG Key. More...
#include <d2_config.h>
Public Member Functions | |
TSIGKeyInfo (const std::string &name, const std::string &algorithm, const std::string &secret, std::string secret_file="", uint32_t digestbits=0) | |
Constructor. | |
virtual | ~TSIGKeyInfo () |
Destructor. | |
const std::string | getAlgorithm () const |
Getter which returns the key's algorithm string ID. | |
uint32_t | getDigestbits () const |
Getter which returns the key's minimum truncated length. | |
const std::string | getName () const |
Getter which returns the key's name. | |
const std::string | getSecret () const |
Getter which returns the key's secret. | |
const std::string | getSecretFile () const |
Getter which returns the secret file name. | |
const D2TsigKeyPtr & | getTSIGKey () const |
Getter which returns the TSIG key used to sign and verify messages. | |
virtual isc::data::ElementPtr | toElement () const |
Unparse a configuration object. | |
Public Member Functions inherited from isc::data::UserContext | |
void | contextToElement (data::ElementPtr map) const |
Merge unparse a user_context object. | |
data::ConstElementPtr | getContext () const |
Returns const pointer to the user context. | |
void | setContext (const data::ConstElementPtr &ctx) |
Sets user context. | |
Public Member Functions inherited from isc::data::CfgToElement | |
virtual | ~CfgToElement () |
Destructor. | |
Static Public Member Functions | |
static const dns::Name & | stringToAlgorithmName (const std::string &algorithm_id) |
Converts algorithm id to dns::TSIGKey algorithm dns::Name. | |
Static Public Member Functions inherited from isc::data::UserContext | |
static data::ElementPtr | toElement (data::ConstElementPtr map) |
Copy an Element map. | |
Static Public Attributes | |
static const char * | HMAC_MD5_STR = "HMAC-MD5" |
Defines string values for the supported TSIG algorithms. | |
static const char * | HMAC_SHA1_STR = "HMAC-SHA1" |
static const char * | HMAC_SHA256_STR = "HMAC-SHA256" |
static const char * | HMAC_SHA224_STR = "HMAC-SHA224" |
static const char * | HMAC_SHA384_STR = "HMAC-SHA384" |
static const char * | HMAC_SHA512_STR = "HMAC-SHA512" |
Additional Inherited Members | |
Protected Attributes inherited from isc::data::UserContext | |
data::ConstElementPtr | user_context_ |
Pointer to the user context (may be NULL) | |
Represents a TSIG Key.
Acts as both a storage class containing the basic attributes which describe a TSIG Key, as well as owning and providing access to an instance of the actual key (isc::dns::TSIGKey) that can be used by the IO layer for signing and verifying messages.
Definition at line 266 of file d2_config.h.
isc::d2::TSIGKeyInfo::TSIGKeyInfo | ( | const std::string & | name, |
const std::string & | algorithm, | ||
const std::string & | secret, | ||
std::string | secret_file = "", | ||
uint32_t | digestbits = 0 ) |
Constructor.
name | the unique label used to identify this key |
algorithm | the id of the encryption algorithm this key uses. Currently supported values are (case insensitive):
|
secret | The base-64 encoded secret component for this key. (A suitable string for use here could be obtained by running the BIND 9 dnssec-keygen program; the contents of resulting key file will look similar to: Private-key-format: v1.3
Algorithm: 157 (HMAC_MD5)
Key: LSWXnfkKZjdPJI5QxlpnfQ==
Bits: AAA=
Created: 20140515143700
Publish: 20140515143700
Activate: 20140515143700
|
secret_file | The file name where the secret can be found. |
digestbits | the minimum truncated length in bits |
D2CfgError | if values supplied are invalid: name cannot be blank, algorithm must be a supported value, secret must be a non-blank, base64 encoded string. |
Definition at line 130 of file d2_config.cc.
|
virtual |
Destructor.
Definition at line 138 of file d2_config.cc.
|
inline |
Getter which returns the key's algorithm string ID.
Definition at line 327 of file d2_config.h.
|
inline |
Getter which returns the key's minimum truncated length.
Definition at line 334 of file d2_config.h.
|
inline |
Getter which returns the key's name.
Definition at line 320 of file d2_config.h.
|
inline |
Getter which returns the key's secret.
Definition at line 341 of file d2_config.h.
|
inline |
Getter which returns the secret file name.
Definition at line 348 of file d2_config.h.
|
inline |
Getter which returns the TSIG key used to sign and verify messages.
D2TsigKeyPtr
Definition at line 356 of file d2_config.h.
|
static |
Converts algorithm id to dns::TSIGKey algorithm dns::Name.
algorithm_id | string value to translate into an algorithm name. Currently supported values are (case insensitive):
|
BadValue | if ID isn't recognized. |
Definition at line 142 of file d2_config.cc.
References HMAC_MD5_STR, HMAC_SHA1_STR, HMAC_SHA224_STR, HMAC_SHA256_STR, HMAC_SHA384_STR, HMAC_SHA512_STR, isc::dns::TSIGKey::HMACMD5_NAME(), isc::dns::TSIGKey::HMACSHA1_NAME(), isc::dns::TSIGKey::HMACSHA224_NAME(), isc::dns::TSIGKey::HMACSHA256_NAME(), isc::dns::TSIGKey::HMACSHA384_NAME(), isc::dns::TSIGKey::HMACSHA512_NAME(), and isc_throw.
Referenced by isc::d2::TSIGKeyInfoParser::parse().
|
virtual |
Unparse a configuration object.
Implements isc::data::CfgToElement.
Definition at line 181 of file d2_config.cc.
References isc::data::UserContext::contextToElement(), isc::data::Element::create(), and isc::data::Element::createMap().
|
static |
Defines string values for the supported TSIG algorithms.
Definition at line 270 of file d2_config.h.
Referenced by stringToAlgorithmName().
|
static |
Definition at line 271 of file d2_config.h.
Referenced by stringToAlgorithmName().
|
static |
Definition at line 273 of file d2_config.h.
Referenced by isc::d2::TSIGKeyInfoParser::parse(), and stringToAlgorithmName().
|
static |
Definition at line 272 of file d2_config.h.
Referenced by isc::d2::TSIGKeyInfoParser::parse(), and stringToAlgorithmName().
|
static |
Definition at line 274 of file d2_config.h.
Referenced by isc::d2::TSIGKeyInfoParser::parse(), and stringToAlgorithmName().
|
static |
Definition at line 275 of file d2_config.h.
Referenced by isc::d2::TSIGKeyInfoParser::parse(), and stringToAlgorithmName().