A class for managing digital signing and signature verification.
More...
#include <signer.hxx>
|
| Signer (const Algorithm::Sign &algorithm, const KeyPair &keypair) noexcept |
| Constructs a Signer instance with a specified algorithm and key pair.
|
|
| Signer (const Algorithm::Sign &algorithm, KeyPair &&keypair) noexcept |
| Constructs a Signer instance with a specified algorithm and key pair (move version).
|
|
| Signer (const Signer &signer)=default |
| Copy constructor for the Signer class.
|
|
| Signer (Signer &&signer) noexcept=default |
| Move constructor for the Signer class.
|
|
| ~Signer () noexcept=default |
| Destructor for the Signer class.
|
|
Signer & | operator= (const Signer &signer)=default |
| Copy assignment operator for the Signer class.
|
|
Signer & | operator= (Signer &&signer) noexcept=default |
| Move assignment operator for the Signer class.
|
|
Expected< std::string, Exception > | Sign (const std::string &input) const noexcept |
| Signs a string input using the specified signing algorithm.
|
|
Expected< std::string, Exception > | Sign (const Buffer::Simple &buffer) const noexcept |
| Signs a buffer using the specified signing algorithm.
|
|
Buffer::Consumer | Sign (const Buffer::Consumer consumer) const noexcept |
| Signs data asynchronously using a Consumer/Producer model.
|
|
bool | Verify (const std::string &message, const std::string &signature) const noexcept |
| Verifies a digital signature for a string message.
|
|
bool | Verify (const Buffer::Simple &buffer, const std::string &signature) const noexcept |
| Verifies a digital signature for a buffer.
|
|
bool | Verify (const Buffer::Consumer consumer, const std::string &signature) const noexcept |
| Verifies a digital signature for data provided by a Consumer buffer.
|
|
A class for managing digital signing and signature verification.
This class provides methods for creating digital signatures and verifying them using various signing algorithms.
◆ Signer() [1/4]
StormByte::Crypto::Signer::Signer |
( |
const Algorithm::Sign & |
algorithm, |
|
|
const KeyPair & |
keypair |
|
) |
| |
|
explicitnoexcept |
Constructs a Signer instance with a specified algorithm and key pair.
This constructor initializes the Signer
instance with the specified signing algorithm and a key pair. The key pair is used for signing and verifying operations.
- Parameters
-
algorithm | The signing algorithm to use. |
keypair | The key pair to use for signing and verifying. |
◆ Signer() [2/4]
StormByte::Crypto::Signer::Signer |
( |
const Algorithm::Sign & |
algorithm, |
|
|
KeyPair && |
keypair |
|
) |
| |
|
explicitnoexcept |
Constructs a Signer instance with a specified algorithm and key pair (move version).
This constructor initializes the Signer
instance with the specified signing algorithm and a key pair. The key pair is moved into the instance to avoid unnecessary copying.
- Parameters
-
algorithm | The signing algorithm to use. |
keypair | The key pair to use for signing and verifying (rvalue reference). |
◆ Signer() [3/4]
StormByte::Crypto::Signer::Signer |
( |
const Signer & |
signer | ) |
|
|
default |
Copy constructor for the Signer class.
Creates a copy of the given Signer
instance.
- Parameters
-
signer | The Signer instance to copy. |
◆ Signer() [4/4]
StormByte::Crypto::Signer::Signer |
( |
Signer && |
signer | ) |
|
|
defaultnoexcept |
Move constructor for the Signer class.
Moves the given Signer
instance into the current instance.
- Parameters
-
signer | The Signer instance to move. |
◆ ~Signer()
StormByte::Crypto::Signer::~Signer |
( |
| ) |
|
|
defaultnoexcept |
Destructor for the Signer class.
Cleans up the Signer
instance.
◆ operator=() [1/2]
Signer & StormByte::Crypto::Signer::operator= |
( |
const Signer & |
signer | ) |
|
|
default |
Copy assignment operator for the Signer class.
Assigns the values from the given Signer
instance to the current instance.
- Parameters
-
signer | The Signer instance to copy. |
- Returns
- A reference to the updated
Signer
instance.
◆ operator=() [2/2]
Signer & StormByte::Crypto::Signer::operator= |
( |
Signer && |
signer | ) |
|
|
defaultnoexcept |
Move assignment operator for the Signer class.
Moves the values from the given Signer
instance to the current instance.
- Parameters
-
signer | The Signer instance to move. |
- Returns
- A reference to the updated
Signer
instance.
◆ Sign() [1/3]
Buffer::Consumer StormByte::Crypto::Signer::Sign |
( |
const Buffer::Consumer |
consumer | ) |
const |
|
noexcept |
Signs data asynchronously using a Consumer/Producer model.
This method creates a digital signature for the data provided by the Consumer buffer.
- Parameters
-
consumer | The Consumer buffer containing the input data. |
- Returns
- A Consumer buffer containing the digital signature.
◆ Sign() [2/3]
Expected< std::string, Exception > StormByte::Crypto::Signer::Sign |
( |
const Buffer::Simple & |
buffer | ) |
const |
|
noexcept |
Signs a buffer using the specified signing algorithm.
This method creates a digital signature for the given buffer.
- Parameters
-
buffer | The buffer to sign. |
- Returns
- An Expected containing the digital signature or an error.
◆ Sign() [3/3]
Expected< std::string, Exception > StormByte::Crypto::Signer::Sign |
( |
const std::string & |
input | ) |
const |
|
noexcept |
Signs a string input using the specified signing algorithm.
This method creates a digital signature for the given string input.
- Parameters
-
- Returns
- An Expected containing the digital signature or an error.
◆ Verify() [1/3]
bool StormByte::Crypto::Signer::Verify |
( |
const Buffer::Consumer |
consumer, |
|
|
const std::string & |
signature |
|
) |
| const |
|
noexcept |
Verifies a digital signature for data provided by a Consumer buffer.
This method verifies the digital signature of the data provided by the Consumer buffer.
- Parameters
-
consumer | The Consumer buffer containing the original data. |
signature | The digital signature to verify. |
- Returns
true
if the signature is valid, false
otherwise.
◆ Verify() [2/3]
bool StormByte::Crypto::Signer::Verify |
( |
const Buffer::Simple & |
buffer, |
|
|
const std::string & |
signature |
|
) |
| const |
|
noexcept |
Verifies a digital signature for a buffer.
This method verifies the digital signature of the given buffer.
- Parameters
-
buffer | The original buffer. |
signature | The digital signature to verify. |
- Returns
true
if the signature is valid, false
otherwise.
◆ Verify() [3/3]
bool StormByte::Crypto::Signer::Verify |
( |
const std::string & |
message, |
|
|
const std::string & |
signature |
|
) |
| const |
|
noexcept |
Verifies a digital signature for a string message.
This method verifies the digital signature of the given string message.
- Parameters
-
message | The original message. |
signature | The digital signature to verify. |
- Returns
true
if the signature is valid, false
otherwise.
The documentation for this class was generated from the following file:
- /home/runner/work/StormByte-Crypto/StormByte-Crypto/lib/public/StormByte/crypto/signer.hxx