Kea: isc::gss_tsig::GssTsigKey Class Reference

| Kea 3.2.0-git

isc::gss_tsig::GssTsigKey Class Reference

GSS-TSIG extension of the D2 TSIG key class. More...

`#include <gss_tsig_key.h>`

Inheritance diagram for isc::gss_tsig::GssTsigKey:
[legend]

## Public Member Functions
| GssTsigKey (const std::string &key_name, const std::vector< uint8_t > &import)
| Constructor.
| GssTsigKey (const std::string &key_name, gss_ctx_id_t sec_ctx=GSS_C_NO_CONTEXT)
| Constructor.
virtual | ~GssTsigKey ()
| Destructor.
std::chrono::system_clock::time_point | getExpire () const
| Get the key expire.
uint32_t | getExpire32 () const
| Get the key expire (32 bits).
std::chrono::system_clock::time_point | getInception () const
| Get the key inception.
uint32_t | getInception32 () const
| Get the key inception (32 bits).
GssApiSecCtx & | getSecCtx ()
| Get the security context.
void | setExpire (const std::chrono::system_clock::time_point &expire)
| Set the key expire.
void | setInception (const std::chrono::system_clock::time_point &inception)
| Set the key inception.
Public Member Functions inherited from isc::d2::D2TsigKey
| D2TsigKey (const dns::Name &key_name, const dns::Name &algorithm_name, const void *secret, size_t secret_len, size_t digestbits=0)
| Constructor.
| D2TsigKey (const std::string &key_spec)
| Constructor.
virtual | ~D2TsigKey ()
| Destructor.
virtual dns::TSIGContextPtr | createContext ()
| Create TSIG context.
virtual void | resetStats ()
| Reset statistics.
Public Member Functions inherited from isc::dns::TSIGKey
| TSIGKey (const Name &key_name, const Name &algorithm_name, const void *secret, size_t secret_len, size_t digestbits=0)
| Constructors, Assignment Operator and Destructor.
| TSIGKey (const std::string &str)
| Constructor from an input string.
| TSIGKey (const TSIGKey &source)
| The copy constructor.
virtual | ~TSIGKey ()
| The destructor.
isc::cryptolink::HashAlgorithm | getAlgorithm () const
| Return the hash algorithm name in the form of cryptolink::HashAlgorithm.
const Name & | getAlgorithmName () const
| Return the algorithm name.
size_t | getDigestbits () const
| Return the minimum truncated length.
const Name & | getKeyName () const
| Getter Methods.
const void * | getSecret () const
| Return the value of the TSIG secret.
size_t | getSecretLength () const
| Return the length of the TSIG secret in bytes.
TSIGKey & | operator= (const TSIGKey &source)
| Assignment operator.
std::string | toText () const
| Converts the TSIGKey to a string value.

## Protected Attributes
std::chrono::system_clock::time_point | expire_
| The key expire date.
std::chrono::system_clock::time_point | inception_
| The key inception date.
std::unique_ptr< GssApiSecCtx > | sec_ctx_
| GSS-API security context.

## Additional Inherited Members
Static Public Member Functions inherited from isc::dns::TSIGKey
static const Name & | GSSTSIG_NAME ()
static const Name & | HMACMD5_NAME ()
| Well known algorithm names as defined in RFC2845 and RFC4635.
static const Name & | HMACMD5_SHORT_NAME ()
static const Name & | HMACSHA1_NAME ()
static const Name & | HMACSHA224_NAME ()
static const Name & | HMACSHA256_NAME ()
static const Name & | HMACSHA384_NAME ()
static const Name & | HMACSHA512_NAME ()

## Detailed Description

GSS-TSIG extension of the D2 TSIG key class.

Implements a `isc::d2::D2TsigKey` derived class which can be used as the value of D2TsigKeyPtr so with minimal or no update to the DNS++ library. The class adds to the D2TsigKey base a GSS-API security context maintaining 1::1 binding the key and it including for the lifetime: e.g. to get a fresh GSS-API security context a fresh object must be created.

Definition at line 26 of file gss_tsig_key.h.

## Constructor & Destructor Documentation

## ◆ GssTsigKey() [1/2]

isc::gss_tsig::GssTsigKey::GssTsigKey | ( | const std::string & | key_name,
|  | gss_ctx_id_t | sec_ctx = GSS_C_NO_CONTEXT )

Constructor.

Parameters

  key_name | Domain name of the key.
  sec_ctx | Security context (can be 0).

Definition at line 18 of file gss_tsig_key.cc.

References isc::d2::D2TsigKey::D2TsigKey(), and sec_ctx_.

Referenced by isc::gss_tsig::ManagedKey::ManagedKey().

Here is the call graph for this function:

## ◆ GssTsigKey() [2/2]

isc::gss_tsig::GssTsigKey::GssTsigKey | ( | const std::string & | key_name,
|  | const std::vector< uint8_t > & | import )

Constructor.

Use the gss_import_sec_context GSS-API function. This constructor is expected to be used for restoring / importing a security context saved on disk.

Parameters

  key_name | Domain name of the key.
  import | Vector of byte representing the GSS-API security context.

Definition at line 22 of file gss_tsig_key.cc.

References isc::d2::D2TsigKey::D2TsigKey(), and sec_ctx_.

Here is the call graph for this function:

## ◆ ~GssTsigKey()

isc::gss_tsig::GssTsigKey::~GssTsigKey | ( |  | ) |
| virtual

Destructor.

Definition at line 26 of file gss_tsig_key.cc.

## Member Function Documentation

## ◆ getExpire()

std::chrono::system_clock::time_point isc::gss_tsig::GssTsigKey::getExpire | ( |  | ) | const
| inline

Get the key expire.

Returns
  The key expire date.

Definition at line 84 of file gss_tsig_key.h.

References expire_.

## ◆ getExpire32()

uint32_t isc::gss_tsig::GssTsigKey::getExpire32 | ( |  | ) | const
| inline

Get the key expire (32 bits).

Returns
  The key expire date as a 32 bit unsigned.

Definition at line 91 of file gss_tsig_key.h.

References expire_.

## ◆ getInception()

std::chrono::system_clock::time_point isc::gss_tsig::GssTsigKey::getInception | ( |  | ) | const
| inline

Get the key inception.

Returns
  The key inception date.

Definition at line 62 of file gss_tsig_key.h.

References inception_.

## ◆ getInception32()

uint32_t isc::gss_tsig::GssTsigKey::getInception32 | ( |  | ) | const
| inline

Get the key inception (32 bits).

Returns
  The key inception date as a 32 bit unsigned.

Definition at line 69 of file gss_tsig_key.h.

References inception_.

## ◆ getSecCtx()

GssApiSecCtx & isc::gss_tsig::GssTsigKey::getSecCtx | ( |  | ) |
| inline

Get the security context.

Note
  : By construction the sec_ctx_ pointer is never null but the security context lifetime is the same as the key object.

Returns
  The security context.

Definition at line 55 of file gss_tsig_key.h.

References sec_ctx_.

## ◆ setExpire()

void isc::gss_tsig::GssTsigKey::setExpire | ( | const std::chrono::system_clock::time_point & | expire | ) |
| inline

Set the key expire.

Parameters

  expire | The new key expire date.

Definition at line 99 of file gss_tsig_key.h.

References expire_.

## ◆ setInception()

void isc::gss_tsig::GssTsigKey::setInception | ( | const std::chrono::system_clock::time_point & | inception | ) |
| inline

Set the key inception.

Parameters

  inception | The new key inception date.

Definition at line 77 of file gss_tsig_key.h.

References inception_.

## Member Data Documentation

## ◆ expire_

std::chrono::system_clock::time_point isc::gss_tsig::GssTsigKey::expire_
| protected

The key expire date.

Definition at line 111 of file gss_tsig_key.h.

Referenced by getExpire(), getExpire32(), setExpire(), and isc::gss_tsig::ManagedKey::toElement().

## ◆ inception_

std::chrono::system_clock::time_point isc::gss_tsig::GssTsigKey::inception_
| protected

The key inception date.

Definition at line 108 of file gss_tsig_key.h.

Referenced by getInception(), getInception32(), setInception(), and isc::gss_tsig::ManagedKey::toElement().

## ◆ sec_ctx_

std::unique_ptr<GssApiSecCtx> isc::gss_tsig::GssTsigKey::sec_ctx_
| protected

GSS-API security context.

Definition at line 105 of file gss_tsig_key.h.

Referenced by GssTsigKey(), GssTsigKey(), getSecCtx(), and isc::gss_tsig::ManagedKey::toElement().

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

- gss_tsig_key.h
- gss_tsig_key.cc