![]() |
Kea 2.2.0
|
Authentication keys. More...
#include <host.h>
Public Member Functions | |
| AuthKey () | |
| Constructor. More... | |
| AuthKey (const std::string &key) | |
| Constructor. More... | |
| AuthKey (const std::vector< uint8_t > &key) | |
| Constructor. More... | |
| const std::vector< uint8_t > & | getAuthKey () const |
| Return auth key. More... | |
| bool | operator!= (const AuthKey &other) const |
| Inequality operator. More... | |
| bool | operator== (const AuthKey &other) const |
| Equality operator. More... | |
| void | setAuthKey (const std::string &key) |
| Set auth key value from hexadecimal. More... | |
| void | setAuthKey (const std::vector< uint8_t > &key) |
| Set auth key value from binary. More... | |
| std::string | toText () const |
| Return text format for keys. More... | |
Static Public Member Functions | |
| static std::vector< uint8_t > | getRandomKeyString () |
| Random string is generated by default will be used for the keys to be used for signing Reconfigure Message. More... | |
Authentication keys.
This class represents authentication keys to be used for calculating HMAC in the authentication field of the reconfigure message.
| isc::dhcp::AuthKey::AuthKey | ( | const std::vector< uint8_t > & | key | ) |
Constructor.
Constructor for assigning auth keys in host reservation. Ensures the key length is not greater than 16 bytes.
| key | auth key in binary to be stored. |
Definition at line 25 of file host.cc.
References setAuthKey().
Here is the call graph for this function:| isc::dhcp::AuthKey::AuthKey | ( | const std::string & | key | ) |
Constructor.
Constructor for assigning auth keys in host reservation. Ensures the key length is not greater than AUTH_KEY_LEN (16) bytes so TEXT_AUTH_KEY_LEN (32) hexadecimal digits. See setKey for constraints on its input format.
| key | auth key in hexadecimal to be stored. |
Definition at line 29 of file host.cc.
References setAuthKey().
Here is the call graph for this function:| isc::dhcp::AuthKey::AuthKey | ( | ) |
Constructor.
Constructor for generating auth keys, with no argument. shall use the internal function for generationg random keys.
Definition at line 33 of file host.cc.
References getRandomKeyString().
Here is the call graph for this function:
|
inline |
|
static |
Random string is generated by default will be used for the keys to be used for signing Reconfigure Message.
Definition at line 38 of file host.cc.
References isc::dhcp::AUTH_KEY_LEN, and isc::cryptolink::random().
Referenced by AuthKey().
Here is the call graph for this function:| bool isc::dhcp::AuthKey::operator!= | ( | const AuthKey & | other | ) | const |
| bool isc::dhcp::AuthKey::operator== | ( | const AuthKey & | other | ) | const |
| void isc::dhcp::AuthKey::setAuthKey | ( | const std::string & | key | ) |
Set auth key value from hexadecimal.
Set the key value. If the size is greater than 16 bytes, we resize to 16 bytes.
| key | auth key in hexadecimal to be stored. |
| BadValue | if the string is not a valid hexadecimal encoding, for instance has a not hexadecimal or odd number of digits. |
Definition at line 59 of file host.cc.
References isc::util::encode::decodeHex(), isc_throw, setAuthKey(), and isc::Exception::what().
Here is the call graph for this function:| void isc::dhcp::AuthKey::setAuthKey | ( | const std::vector< uint8_t > & | key | ) |
Set auth key value from binary.
Set the key value. Doesn't throw an exception.
| key | auth key in binary to be stored |
Definition at line 51 of file host.cc.
References isc::dhcp::AUTH_KEY_LEN.
Referenced by AuthKey(), and setAuthKey().
| std::string isc::dhcp::AuthKey::toText | ( | ) | const |
Return text format for keys.
Definition at line 43 of file host.cc.
References isc::util::encode::encodeHex().
Referenced by isc::dhcp::Host::toText().
Here is the call graph for this function: