join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::Hmacbuf Class Reference

HMAC stream buffer. More...

#include <hmac.hpp>

Inheritance diagram for join::Hmacbuf:
Collaboration diagram for join::Hmacbuf:

Public Member Functions

 Hmacbuf (const std::string &algo, const std::string &key)
 create HMAC stream buffer instance.
 
 Hmacbuf (const Hmacbuf &other)=delete
 copy constructor.
 
Hmacbufoperator= (const Hmacbuf &other)=delete
 copy assignment operator.
 
 Hmacbuf (Hmacbuf &&other)
 move constructor.
 
Hmacbufoperator= (Hmacbuf &&other)
 move assignment operator.
 
virtual ~Hmacbuf ()=default
 destroy HMAC stream buffer instance.
 
BytesArray finalize ()
 get keyed-hash message authentication code.
 

Protected Member Functions

virtual int_type overflow (int_type c=traits_type::eof()) override
 writes characters to the associated output sequence from the put area.
 

Protected Attributes

std::unique_ptr< char[]> _buf
 internal buffer.
 
const EVP_MD * _md
 message digest.
 
HmacCtxPtr _ctx
 context.
 
std::string _key
 key.
 

Static Protected Attributes

static const std::streamsize _bufsize = 256
 internal buffer size.
 

Detailed Description

HMAC stream buffer.

Constructor & Destructor Documentation

◆ Hmacbuf() [1/3]

Hmacbuf::Hmacbuf ( const std::string & algo,
const std::string & key )

create HMAC stream buffer instance.

Parameters
algothe message digest algorithm used.
keykey.

◆ Hmacbuf() [2/3]

join::Hmacbuf::Hmacbuf ( const Hmacbuf & other)
delete

copy constructor.

Parameters
otherother object to copy.

◆ Hmacbuf() [3/3]

Hmacbuf::Hmacbuf ( Hmacbuf && other)

move constructor.

Parameters
otherother object to move.

◆ ~Hmacbuf()

virtual join::Hmacbuf::~Hmacbuf ( )
virtualdefault

destroy HMAC stream buffer instance.

Member Function Documentation

◆ finalize()

BytesArray Hmacbuf::finalize ( )

get keyed-hash message authentication code.

Returns
keyed-hash message authentication code.

◆ operator=() [1/2]

Hmacbuf & join::Hmacbuf::operator= ( const Hmacbuf & other)
delete

copy assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ operator=() [2/2]

Hmacbuf & Hmacbuf::operator= ( Hmacbuf && other)

move assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ overflow()

Hmacbuf::int_type Hmacbuf::overflow ( int_type c = traits_type::eof ())
overrideprotectedvirtual

writes characters to the associated output sequence from the put area.

Parameters
cthe character to store in the put area.
Returns
EOF on failure, some other value on success.

Member Data Documentation

◆ _buf

std::unique_ptr<char []> join::Hmacbuf::_buf
protected

internal buffer.

◆ _bufsize

const std::streamsize join::Hmacbuf::_bufsize = 256
staticprotected

internal buffer size.

◆ _ctx

HmacCtxPtr join::Hmacbuf::_ctx
protected

context.

◆ _key

std::string join::Hmacbuf::_key
protected

key.

◆ _md

const EVP_MD* join::Hmacbuf::_md
protected

message digest.


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