![]() |
Kea
1.9.9-git
|
Authentication keys. More...
#include <host.h>
Public Member Functions | |
| AuthKey (const std::vector< uint8_t > &key) | |
| Constructor. More... | |
| AuthKey (const std::string &key) | |
| Constructor. More... | |
| AuthKey () | |
| 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::vector< uint8_t > &key) |
| Set auth key value from binary. More... | |
| void | setAuthKey (const std::string &key) |
| Set auth key value from hexadecimal. 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 | ) |
| 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. |
| isc::dhcp::AuthKey::AuthKey | ( | ) |
|
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().
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::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.
| 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, and isc::Exception::what().
Here is the call graph for this function:| 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: