StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
StormByte::Crypto::Signer::Generic Class Referenceabstract

A generic signer class. More...

#include <generic.hxx>

Inheritance diagram for StormByte::Crypto::Signer::Generic:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Crypto::Signer::Generic:
Collaboration graph
[legend]

Public Member Functions

 Generic (const Generic &other)=default
 Copy constructor.
 
 Generic (Generic &&other) noexcept=default
 Move constructor.
 
virtual ~Generic () noexcept=default
 Virtual destructor.
 
Genericoperator= (const Generic &other)=default
 Copy assignment operator.
 
Genericoperator= (Generic &&other) noexcept=default
 Move assignment operator.
 
KeyPair::Generic::PointerType KeyPair () const noexcept
 Gets the keypair used for asymmetric encryption.
 
bool Sign (std::span< const std::byte > input, Buffer::WriteOnly &output) const noexcept
 Sign data from input span to output buffer.
 
bool Sign (const Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Sign data from input buffer to output buffer.
 
bool Sign (Buffer::ReadOnly &input, Buffer::WriteOnly &output) const noexcept
 Sign data from input buffer to output buffer, moving the input data.
 
Buffer::Consumer Sign (Buffer::Consumer consumer, ReadMode mode=ReadMode::Move) const noexcept
 Sign data from a Consumer buffer.
 
bool Verify (std::span< const std::byte > input, const std::string &signature) const noexcept
 Verify data from input span to output buffer.
 
bool Verify (const Buffer::ReadOnly &input, const std::string &signature) const noexcept
 Verify data from input buffer to output buffer.
 
bool Verify (Buffer::ReadOnly &input, const std::string &signature) const noexcept
 Verify data from input buffer to output buffer, moving the input data.
 
bool Verify (Buffer::Consumer consumer, const std::string &signature, ReadMode mode=ReadMode::Move) const noexcept
 Verify data from a Consumer buffer.
 

Protected Member Functions

 Generic (enum Type type, KeyPair::Generic::PointerType keypair)
 Constructor.
 
 Generic (enum Type type, const KeyPair::Generic &keypair)
 Constructor.
 
 Generic (enum Type type, KeyPair::Generic &&keypair)
 Constructor.
 

Protected Attributes

enum Type m_type
 The type of signer.
 
KeyPair::Generic::PointerType m_keypair
 The password used for asymmetric encryption.
 

Detailed Description

A generic signer class.

Constructor & Destructor Documentation

◆ Generic() [1/5]

StormByte::Crypto::Signer::Generic::Generic ( const Generic other)
default

Copy constructor.

Parameters
otherThe other Generic signer to copy from.

◆ Generic() [2/5]

StormByte::Crypto::Signer::Generic::Generic ( Generic &&  other)
defaultnoexcept

Move constructor.

Parameters
otherThe other Generic signer to move from.

◆ Generic() [3/5]

StormByte::Crypto::Signer::Generic::Generic ( enum Type  type,
KeyPair::Generic::PointerType  keypair 
)
inlineprotected

Constructor.

Parameters
typeThe type of signer.
keypairThe keypair used for asymmetric encryption.

◆ Generic() [4/5]

StormByte::Crypto::Signer::Generic::Generic ( enum Type  type,
const KeyPair::Generic keypair 
)
inlineprotected

Constructor.

Parameters
typeThe type of signer.
keypairThe keypair used for asymmetric encryption.

◆ Generic() [5/5]

StormByte::Crypto::Signer::Generic::Generic ( enum Type  type,
KeyPair::Generic &&  keypair 
)
inlineprotected

Constructor.

Parameters
typeThe type of signer.
keypairThe keypair used for asymmetric encryption.

Member Function Documentation

◆ KeyPair()

KeyPair::Generic::PointerType StormByte::Crypto::Signer::Generic::KeyPair ( ) const
inlinenoexcept

Gets the keypair used for asymmetric encryption.

Returns
The keypair.

◆ operator=() [1/2]

Generic & StormByte::Crypto::Signer::Generic::operator= ( const Generic other)
default

Copy assignment operator.

Parameters
otherThe other Generic signer to copy from.
Returns
Reference to this Generic signer.

◆ operator=() [2/2]

Generic & StormByte::Crypto::Signer::Generic::operator= ( Generic &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherThe other Generic signer to move from.
Returns
Reference to this Generic signer.

◆ Sign() [1/4]

Buffer::Consumer StormByte::Crypto::Signer::Generic::Sign ( Buffer::Consumer  consumer,
ReadMode  mode = ReadMode::Move 
) const
inlinenoexcept

Sign data from a Consumer buffer.

Parameters
consumerThe Consumer buffer to sign.
modeThe read mode indicating copy or move.
Returns
A Consumer buffer containing the signed data.

◆ Sign() [2/4]

bool StormByte::Crypto::Signer::Generic::Sign ( Buffer::ReadOnly &  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Sign data from input buffer to output buffer, moving the input data.

Parameters
inputThe input buffer to sign.
outputThe output buffer to write the signed data to.
Returns
true if signing was successful, false otherwise.

◆ Sign() [3/4]

bool StormByte::Crypto::Signer::Generic::Sign ( const Buffer::ReadOnly &  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Sign data from input buffer to output buffer.

Parameters
inputThe input buffer to sign.
outputThe output buffer to write the signed data to.
Returns
true if signing was successful, false otherwise.

◆ Sign() [4/4]

bool StormByte::Crypto::Signer::Generic::Sign ( std::span< const std::byte >  input,
Buffer::WriteOnly &  output 
) const
inlinenoexcept

Sign data from input span to output buffer.

Parameters
inputThe input data span to sign.
outputThe output buffer to write the signed data to.
Returns
true if signing was successful, false otherwise.

◆ Verify() [1/4]

bool StormByte::Crypto::Signer::Generic::Verify ( Buffer::Consumer  consumer,
const std::string &  signature,
ReadMode  mode = ReadMode::Move 
) const
inlinenoexcept

Verify data from a Consumer buffer.

Parameters
consumerThe Consumer buffer to verify.
signatureThe signature to verify against.
modeThe read mode indicating copy or move.
Returns
A Consumer buffer containing the verified data.

◆ Verify() [2/4]

bool StormByte::Crypto::Signer::Generic::Verify ( Buffer::ReadOnly &  input,
const std::string &  signature 
) const
inlinenoexcept

Verify data from input buffer to output buffer, moving the input data.

Parameters
inputThe input buffer to verify.
signatureThe signature to verify against.
Returns
true if verification was successful, false otherwise.

◆ Verify() [3/4]

bool StormByte::Crypto::Signer::Generic::Verify ( const Buffer::ReadOnly &  input,
const std::string &  signature 
) const
inlinenoexcept

Verify data from input buffer to output buffer.

Parameters
inputThe input buffer to verify.
signatureThe signature to verify against.
Returns
true if verification was successful, false otherwise.

◆ Verify() [4/4]

bool StormByte::Crypto::Signer::Generic::Verify ( std::span< const std::byte >  input,
const std::string &  signature 
) const
inlinenoexcept

Verify data from input span to output buffer.

Parameters
inputThe input buffer to verify.
signatureThe signature to verify against.
Returns
true if verification was successful, false otherwise.

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