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

signature stream buffer. More...

#include <signature.hpp>

Inheritance diagram for join::Signaturebuf:
Collaboration diagram for join::Signaturebuf:

Public Member Functions

 Signaturebuf (const std::string &algo)
 create the signature stream buffer instance.
 
 Signaturebuf (const Signaturebuf &other)=delete
 copy constructor.
 
Signaturebufoperator= (const Signaturebuf &other)=delete
 copy assignment operator.
 
 Signaturebuf (Signaturebuf &&other)=default
 move constructor.
 
Signaturebufoperator= (Signaturebuf &&other)=default
 move assignment operator.
 
virtual ~Signaturebuf ()=default
 destroy the signature stream buffer instance.
 
BytesArray sign (const std::string &privKey)
 sign with the given private key.
 
bool verify (const BytesArray &sig, const std::string &pubKey)
 verify signature with the given public key.
 
- Public Member Functions inherited from join::Digestbuf
 Digestbuf (const std::string &algo)
 create digest stream buffer instance.
 
 Digestbuf (const Digestbuf &other)=delete
 copy constructor.
 
Digestbufoperator= (const Digestbuf &other)=delete
 copy assignment operator.
 
 Digestbuf (Digestbuf &&other)
 move constructor.
 
Digestbufoperator= (Digestbuf &&other)
 move assignment operator.
 
virtual ~Digestbuf ()=default
 destroy digest stream buffer instance.
 
BytesArray finalize ()
 get message digest.
 

Additional Inherited Members

- Protected Member Functions inherited from join::Digestbuf
virtual int_type overflow (int_type c=traits_type::eof()) override
 writes characters to the associated output sequence from the put area.
 
- Protected Attributes inherited from join::Digestbuf
std::unique_ptr< char[]> _buf
 internal buffer.
 
const EVP_MD * _md
 message digest.
 
EvpMdCtxPtr _ctx
 message digest context.
 
- Static Protected Attributes inherited from join::Digestbuf
static const std::streamsize _bufsize = 256
 internal buffer size.
 

Detailed Description

signature stream buffer.

Constructor & Destructor Documentation

◆ Signaturebuf() [1/3]

Signaturebuf::Signaturebuf ( const std::string & algo)

create the signature stream buffer instance.

Parameters
algothe message digest used.

◆ Signaturebuf() [2/3]

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

copy constructor.

Parameters
otherother object to copy.

◆ Signaturebuf() [3/3]

join::Signaturebuf::Signaturebuf ( Signaturebuf && other)
default

move constructor.

Parameters
otherother object to move.

◆ ~Signaturebuf()

virtual join::Signaturebuf::~Signaturebuf ( )
virtualdefault

destroy the signature stream buffer instance.

Member Function Documentation

◆ operator=() [1/2]

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

copy assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ operator=() [2/2]

Signaturebuf & join::Signaturebuf::operator= ( Signaturebuf && other)
default

move assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ sign()

BytesArray Signaturebuf::sign ( const std::string & privKey)

sign with the given private key.

Parameters
privKeypath to private key.
Returns
the generated signature on success, an empty bytes array on failure.

◆ verify()

bool Signaturebuf::verify ( const BytesArray & sig,
const std::string & pubKey )

verify signature with the given public key.

Parameters
sigthe message signature.
pubKeypath to public key.
Returns
true on success, false otherwise.

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