| Kea 3.0.2-git

isc::gss_tsig::GssApiBuffer Class Reference

GSS-API buffer. More...

`#include <gss_tsig_api.h>`

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

## Public Member Functions
| GssApiBuffer ()
| Constructor.
| GssApiBuffer (const std::string &content)
| Constructor.
| GssApiBuffer (const std::vector< uint8_t > &content)
| Constructor.
| GssApiBuffer (size_t length, const void *value)
| Constructor.
| ~GssApiBuffer ()
| Destructor.
bool | empty () const
| Empty predicate.
std::vector< uint8_t > | getContent () const
| Get the content as a vector.
size_t | getLength () const
| Get the length.
gss_buffer_t | getPtr ()
| Get pointer.
std::string | getString (bool trim=false) const
| Get the content as a string.
void * | getValue ()
| Get the value.

## Detailed Description

GSS-API buffer.

Encapsulate the gss_buffer_desc (structure with length and value) type.

Note
  : the memory is not shared by constructor and get content methods, i.e. a copy is taken and the source can be destroyed at any time after.

Definition at line 100 of file gss_tsig_api.h.

## Constructor & Destructor Documentation

## ◆ GssApiBuffer() [1/4]

isc::gss_tsig::GssApiBuffer::GssApiBuffer | ( |  | ) |

Constructor.

Definition at line 72 of file gss_tsig_api.cc.

## ◆ GssApiBuffer() [2/4]

isc::gss_tsig::GssApiBuffer::GssApiBuffer | ( | size_t | length,
|  | const void * | value )

Constructor.

Parameters

  length | Buffer length.
  value | Buffer value.

Definition at line 76 of file gss_tsig_api.cc.

References isc_throw.

## ◆ GssApiBuffer() [3/4]

isc::gss_tsig::GssApiBuffer::GssApiBuffer | ( | const std::vector< uint8_t > & | content | ) |
| explicit

Constructor.

Parameters

  content | Content as a vector of bytes.

Definition at line 96 of file gss_tsig_api.cc.

References isc_throw.

## ◆ GssApiBuffer() [4/4]

isc::gss_tsig::GssApiBuffer::GssApiBuffer | ( | const std::string & | content | ) |
| explicit

Constructor.

Parameters

  content | Content as a string.

Definition at line 116 of file gss_tsig_api.cc.

References isc_throw.

## ◆ ~GssApiBuffer()

isc::gss_tsig::GssApiBuffer::~GssApiBuffer | ( |  | ) |

Destructor.

Use gss_release_buffer GSS-API function.

Definition at line 139 of file gss_tsig_api.cc.

## Member Function Documentation

## ◆ empty()

bool isc::gss_tsig::GssApiBuffer::empty | ( |  | ) | const
| inline

Empty predicate.

Returns
  true if empty, false is not empty.

Definition at line 129 of file gss_tsig_api.h.

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

## ◆ getContent()

vector< uint8_t > isc::gss_tsig::GssApiBuffer::getContent | ( |  | ) | const

Get the content as a vector.

Returns
  the content as a vector of bytes.

Definition at line 150 of file gss_tsig_api.cc.

Referenced by isc::gss_tsig::GssApiSecCtx::serialize(), and isc::gss_tsig::GssTsigContext::sign().

## ◆ getLength()

size_t isc::gss_tsig::GssApiBuffer::getLength | ( |  | ) | const
| inline

Get the length.

Returns
  the length.

Definition at line 143 of file gss_tsig_api.h.

Referenced by isc::gss_tsig::GssTsigContext::sign().

## ◆ getPtr()

gss_buffer_t isc::gss_tsig::GssApiBuffer::getPtr | ( |  | ) |
| inline

Get pointer.

Returns
  a pointer to the buffer.

Definition at line 136 of file gss_tsig_api.h.

Referenced by isc::gss_tsig::GssApiOid::GssApiOid(), isc::gss_tsig::GssApiSecCtx::GssApiSecCtx(), isc::gss_tsig::GssApiSecCtx::accept(), isc::gss_tsig::gssApiErrMsg(), isc::gss_tsig::GssApiSecCtx::init(), isc::gss_tsig::GssApiSecCtx::serialize(), isc::gss_tsig::GssApiSecCtx::sign(), isc::gss_tsig::GssApiName::toString(), isc::gss_tsig::GssApiOid::toString(), and isc::gss_tsig::GssApiSecCtx::verify().

## ◆ getString()

string isc::gss_tsig::GssApiBuffer::getString | ( | bool | trim = false | ) | const

Get the content as a string.

Note
  It is not allowed to overload with a different return type so the getContent method name is not available.
  : This is not the same as string(getValue()) because of the way the nul character is handled in C++ strings.

Parameters

  trim | When true treat the buffer as a C string, when false (the default) treat the buffer as a C++ string.

Returns
  the content as a string.

Definition at line 160 of file gss_tsig_api.cc.

Referenced by isc::gss_tsig::GssApiName::toString(), and isc::gss_tsig::GssApiOid::toString().

## ◆ getValue()

void * isc::gss_tsig::GssApiBuffer::getValue | ( |  | ) |
| inline

Get the value.

Note
  : please use this method only to copy the content: the value lifetime is the same as the object.

Returns
  the value.

Definition at line 153 of file gss_tsig_api.h.

Referenced by isc::gss_tsig::gssApiErrMsg(), and isc::gss_tsig::GssTsigContext::sign().

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

- gss_tsig_api.h
- gss_tsig_api.cc