Kea
1.9.9-git
|
Represents a TSIG Key. More...
#include <d2_config.h>
static const char * | HMAC_MD5_STR = "HMAC-MD5" |
Defines string values for the supported TSIG algorithms. More... | |
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" |
TSIGKeyInfo (const std::string &name, const std::string &algorithm, const std::string &secret, uint32_t digestbits=0) | |
Constructor. More... | |
virtual | ~TSIGKeyInfo () |
Destructor. More... | |
const std::string | getName () const |
Getter which returns the key's name. More... | |
const std::string | getAlgorithm () const |
Getter which returns the key's algorithm string ID. More... | |
uint32_t | getDigestbits () const |
Getter which returns the key's minimum truncated length. More... | |
const std::string | getSecret () const |
Getter which returns the key's secret. More... | |
const dns::TSIGKeyPtr & | getTSIGKey () const |
Getter which returns the TSIG key used to sign and verify messages. More... | |
virtual isc::data::ElementPtr | toElement () const |
Unparse a configuration object. More... | |
static const dns::Name & | stringToAlgorithmName (const std::string &algorithm_id) |
Converts algorithm id to dns::TSIGKey algorithm dns::Name. More... | |
Additional Inherited Members | |
Public Member Functions inherited from isc::data::UserContext | |
void | contextToElement (data::ElementPtr map) const |
Merge unparse a user_context object. More... | |
data::ConstElementPtr | getContext () const |
Returns const pointer to the user context. More... | |
void | setContext (const data::ConstElementPtr &ctx) |
Sets user context. More... | |
Public Member Functions inherited from isc::data::CfgToElement | |
virtual | ~CfgToElement () |
Destructor. More... | |
Static Public Member Functions inherited from isc::data::UserContext | |
static data::ElementPtr | toElement (data::ConstElementPtr map) |
Copy an Element map. More... | |
Protected Attributes inherited from isc::data::UserContext | |
data::ConstElementPtr | user_context_ |
Pointer to the user context (may be NULL) More... | |
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 265 of file d2_config.h.
isc::d2::TSIGKeyInfo::TSIGKeyInfo | ( | const std::string & | name, |
const std::string & | algorithm, | ||
const std::string & | secret, | ||
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
|
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 135 of file d2_config.cc.
|
virtual |
Destructor.
Definition at line 142 of file d2_config.cc.
|
inline |
Getter which returns the key's algorithm string ID.
Definition at line 324 of file d2_config.h.
|
inline |
Getter which returns the key's minimum truncated length.
Definition at line 331 of file d2_config.h.
|
inline |
Getter which returns the key's name.
Definition at line 317 of file d2_config.h.
|
inline |
Getter which returns the key's secret.
Definition at line 338 of file d2_config.h.
|
inline |
Getter which returns the TSIG key used to sign and verify messages.
Definition at line 346 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 146 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 185 of file d2_config.cc.
References isc::data::UserContext::contextToElement().
|
static |
Defines string values for the supported TSIG algorithms.
Definition at line 269 of file d2_config.h.
Referenced by stringToAlgorithmName().
|
static |
Definition at line 270 of file d2_config.h.
Referenced by stringToAlgorithmName().
|
static |
Definition at line 272 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 stringToAlgorithmName().
|
static |
Definition at line 274 of file d2_config.h.
Referenced by stringToAlgorithmName().