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

class used to manage signature. More...

#include <signature.hpp>

Inheritance diagram for join::Signature:
Collaboration diagram for join::Signature:

Public Member Functions

 Signature (Digest::Algorithm algo)
 create instance.
 
 Signature (const Signature &other)=delete
 copy constructor.
 
Signatureoperator= (const Signature &other)=delete
 copy assignment operator.
 
 Signature (Signature &&other)
 move constructor.
 
Signatureoperator= (Signature &&other)
 move assignment operator.
 
virtual ~Signature ()=default
 destroy instance.
 
BytesArray sign (const std::string &privKey)
 sign with given private key.
 
bool verify (const BytesArray &signature, const std::string &pubKey)
 verify signature.
 

Static Public Member Functions

static BytesArray sign (const char *data, std::streamsize size, const std::string &privKey, Digest::Algorithm algo)
 sign a data with given private key.
 
static BytesArray sign (const BytesArray &data, const std::string &privKey, Digest::Algorithm algo)
 sign a data with given private key.
 
static BytesArray sign (const std::string &data, const std::string &privKey, Digest::Algorithm algo)
 sign a data with given private key.
 
static bool verify (const char *data, std::streamsize size, const BytesArray &signature, const std::string &pubKey, Digest::Algorithm algo)
 verify data signature.
 
static bool verify (const BytesArray &data, const BytesArray &signature, const std::string &pubKey, Digest::Algorithm algo)
 verify data signature.
 
static bool verify (const std::string &data, const BytesArray &signature, const std::string &pubKey, Digest::Algorithm algo)
 verify data signature.
 

Detailed Description

class used to manage signature.

Constructor & Destructor Documentation

◆ Signature() [1/3]

Signature::Signature ( Digest::Algorithm algo)

create instance.

Parameters
algothe message digest used.

◆ Signature() [2/3]

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

copy constructor.

Parameters
otherother object to copy.

◆ Signature() [3/3]

Signature::Signature ( Signature && other)

move constructor.

Parameters
otherother object to move.

◆ ~Signature()

virtual join::Signature::~Signature ( )
virtualdefault

destroy instance.

Member Function Documentation

◆ operator=() [1/2]

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

copy assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ operator=() [2/2]

Signature & Signature::operator= ( Signature && other)

move assignment operator.

Parameters
otherother object to assign.
Returns
current object.

◆ sign() [1/4]

BytesArray Signature::sign ( const BytesArray & data,
const std::string & privKey,
Digest::Algorithm algo )
static

sign a data with given private key.

Parameters
datadata to sign.
privKeypath to private key.
algothe algorithm used for the signature.
Returns
the generated signature on success, an empty bytes array on failure.

◆ sign() [2/4]

BytesArray Signature::sign ( const char * data,
std::streamsize size,
const std::string & privKey,
Digest::Algorithm algo )
static

sign a data with given private key.

Parameters
datadata buffer to sign.
sizedata buffer size.
privKeypath to private key.
algothe algorithm used for the signature.
Returns
the generated signature on success, an empty bytes array on failure.

◆ sign() [3/4]

BytesArray Signature::sign ( const std::string & data,
const std::string & privKey,
Digest::Algorithm algo )
static

sign a data with given private key.

Parameters
datadata to sign.
privKeypath to private key.
algothe algorithm used for the signature.
Returns
the generated signature on success, an empty bytes array on failure.

◆ sign() [4/4]

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

sign with given private key.

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

◆ verify() [1/4]

bool Signature::verify ( const BytesArray & data,
const BytesArray & signature,
const std::string & pubKey,
Digest::Algorithm algo )
static

verify data signature.

Parameters
datadata to verify.
signaturethe message signature.
pubKeypath to public key.
algothe algorithm used for the signature.
Returns
true on success, false otherwise.

◆ verify() [2/4]

bool Signature::verify ( const BytesArray & signature,
const std::string & pubKey )

verify signature.

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

◆ verify() [3/4]

bool Signature::verify ( const char * data,
std::streamsize size,
const BytesArray & signature,
const std::string & pubKey,
Digest::Algorithm algo )
static

verify data signature.

Parameters
datadata buffer to verify.
datadata buffer size to verify.
signaturethe message signature.
pubKeypath to public key.
algothe algorithm used for the signature.
Returns
true on success, false otherwise.

◆ verify() [4/4]

bool Signature::verify ( const std::string & data,
const BytesArray & signature,
const std::string & pubKey,
Digest::Algorithm algo )
static

verify data signature.

Parameters
datadata to verify.
signaturethe message signature.
pubKeypath to public key.
algothe algorithm used for the signature.
Returns
true on success, false otherwise.

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