3#include <StormByte/buffer/consumer.hxx>
4#include <StormByte/crypto/algorithm.hxx>
5#include <StormByte/crypto/exception.hxx>
6#include <StormByte/crypto/keypair.hxx>
7#include <StormByte/expected.hxx>
15namespace StormByte::Crypto {
22 class STORMBYTE_CRYPTO_PUBLIC
Signer final {
33 explicit Signer(
const Algorithm::Sign& algorithm,
const KeyPair& keypair)
noexcept;
44 explicit Signer(
const Algorithm::Sign& algorithm,
KeyPair&& keypair)
noexcept;
100 Expected<std::
string,
Exception> Sign(const std::
string& input) const noexcept;
111 Expected<std::
string,
Exception> Sign(const Buffer::Simple& buffer) const noexcept;
122 Buffer::Consumer Sign(const Buffer::Consumer consumer) const noexcept;
133 bool Verify(const std::
string& message, const std::
string& signature) const noexcept;
144 bool Verify(const Buffer::Simple& buffer, const std::
string& signature) const noexcept;
155 bool Verify(const Buffer::Consumer consumer, const std::
string& signature) const noexcept;
A class representing an exception in the crypto module.
Definition exception.hxx:15
A class representing a public/private key pair.
Definition keypair.hxx:23
A class for managing digital signing and signature verification.
Definition signer.hxx:22
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() noexcept=default
Destructor for the Signer class.
Signer(const Signer &signer)=default
Copy constructor for the Signer class.
Signer(Signer &&signer) noexcept=default
Move constructor for the Signer class.
The namespace containing cryptographic algorithms.