Kea 3.3.3
gss_tsig_key.h
Go to the documentation of this file.
1// Copyright (C) 2021-2026 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef GSS_TSIG_KEY_H
8#define GSS_TSIG_KEY_H
9
10#include <d2srv/d2_tsig_key.h>
12
13#include <chrono>
14
15#include <boost/shared_ptr.hpp>
16
17namespace isc {
18namespace gss_tsig {
19
28class GssTsigKey : public d2::D2TsigKey {
29public:
34 GssTsigKey(const std::string& key_name,
35 gss_ctx_id_t sec_ctx = GSS_C_NO_CONTEXT);
36
45 GssTsigKey(const std::string& key_name,
46 const std::vector<uint8_t>& import);
47
49 virtual ~GssTsigKey();
50
58 return (*sec_ctx_);
59 }
60
64 std::chrono::system_clock::time_point getInception() const {
65 return (inception_);
66 }
67
71 uint32_t getInception32() const {
72 std::time_t inception = std::chrono::system_clock::to_time_t(inception_);
73 return (static_cast<uint32_t>(inception));
74 }
75
79 void setInception(const std::chrono::system_clock::time_point& inception) {
80 inception_ = inception;
81 }
82
86 std::chrono::system_clock::time_point getExpire() const {
87 return (expire_);
88 }
89
93 uint32_t getExpire32() const {
94 std::time_t expire = std::chrono::system_clock::to_time_t(expire_);
95 return (static_cast<uint32_t>(expire));
96 }
97
101 void setExpire(const std::chrono::system_clock::time_point& expire) {
102 expire_ = expire;
103 }
104
105protected:
107 std::unique_ptr<GssApiSecCtx> sec_ctx_;
108
110 std::chrono::system_clock::time_point inception_;
111
113 std::chrono::system_clock::time_point expire_;
114};
115
117typedef boost::shared_ptr<GssTsigKey> GssTsigKeyPtr;
118
119} // end of namespace isc::gss_tsig
120} // end of namespace isc
121
122#endif // GSS_TSIG_KEY_H
Statistics keeping extension of the DNS TSIGKey class.
Definition d2_tsig_key.h:21
GSS-API security context.
std::chrono::system_clock::time_point getInception() const
Get the key inception.
uint32_t getInception32() const
Get the key inception (32 bits).
std::chrono::system_clock::time_point expire_
The key expire date.
GssApiSecCtx & getSecCtx()
Get the security context.
uint32_t getExpire32() const
Get the key expire (32 bits).
GssTsigKey(const std::string &key_name, gss_ctx_id_t sec_ctx=GSS_C_NO_CONTEXT)
Constructor.
void setExpire(const std::chrono::system_clock::time_point &expire)
Set the key expire.
std::chrono::system_clock::time_point getExpire() const
Get the key expire.
void setInception(const std::chrono::system_clock::time_point &inception)
Set the key inception.
std::unique_ptr< GssApiSecCtx > sec_ctx_
GSS-API security context.
std::chrono::system_clock::time_point inception_
The key inception date.
virtual ~GssTsigKey()
Destructor.
C++ binding for the GSS-API.
boost::shared_ptr< GssTsigKey > GssTsigKeyPtr
Type of pointer to a GSS-TSIG key.
Defines the logger used by the top-level component of kea-lfc.