Kea  1.5.0
isc::dhcp::AuthKey Class Reference

Authentication keys. More...

#include <host.h>

Public Member Functions

 AuthKey (const std::string key)
 Constructor. More...
 
 AuthKey ()
 Constructor. More...
 
std::string getAuthKey ()
 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 More...
 
std::string ToText () const
 return text format for keys More...
 

Static Public Member Functions

static std::string getRandomKeyString ()
 Random string is generated by default will be used for the keys to be used for signing Reconfigure Message. More...
 

Static Public Attributes

static const uint8_t KEY_LEN = 16
 Length of the key - 128 bits. More...
 

Detailed Description

Authentication keys.

This class represents authentication keys to be used for calculating HMAC in the authentication field of the recofigure message

Definition at line 34 of file host.h.

Constructor & Destructor Documentation

◆ AuthKey() [1/2]

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 16 bytes.

Parameters
keyauth key to be stored

Definition at line 25 of file host.cc.

◆ AuthKey() [2/2]

isc::dhcp::AuthKey::AuthKey ( void  )

Constructor.

Constructor for generating auth keys, with no argument. shall use the internal function for generationg random keys.

Definition at line 29 of file host.cc.

Member Function Documentation

◆ getAuthKey()

std::string isc::dhcp::AuthKey::getAuthKey ( )
inline

return auth key

Returns
auth key

Definition at line 71 of file host.h.

◆ getRandomKeyString()

std::string isc::dhcp::AuthKey::getRandomKeyString ( )
static

Random string is generated by default will be used for the keys to be used for signing Reconfigure Message.

Returns
auth keys
Todo:
Move randomization function to cryptolink

Definition at line 34 of file host.cc.

References isc::cryptolink::random().

+ Here is the call graph for this function:

◆ operator!=()

bool isc::dhcp::AuthKey::operator!= ( const AuthKey other) const

inequality operator

inequality operator to compare two AuthKey classes

Parameters
otherAuthkey to be compared against

Definition at line 62 of file host.cc.

◆ operator==()

bool isc::dhcp::AuthKey::operator== ( const AuthKey other) const

equality operator

equality operator to compare two AuthKey classes

Parameters
otherAuthkey to be compared against

Definition at line 57 of file host.cc.

◆ setAuthKey()

void isc::dhcp::AuthKey::setAuthKey ( const std::string &  key)

set auth key value

Set the key value. Doesnt throw an exception

Parameters
keyauth key to be stored

Definition at line 49 of file host.cc.

◆ ToText()

std::string isc::dhcp::AuthKey::ToText ( ) const

return text format for keys

Although returning member would have sufficed this is added incase in future authkey is no longer std::string

Definition at line 43 of file host.cc.

Referenced by isc::dhcp::Host::toText().

Member Data Documentation

◆ KEY_LEN

const uint8_t isc::dhcp::AuthKey::KEY_LEN = 16
static

Length of the key - 128 bits.

Definition at line 37 of file host.h.


The documentation for this class was generated from the following files: