StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
dsa.hxx
1#pragma once
2
3#include <StormByte/crypto/signer/generic.hxx>
4#include <StormByte/crypto/keypair/dsa.hxx>
5
10namespace StormByte::Crypto::Signer {
15 class STORMBYTE_CRYPTO_PUBLIC DSA final: public Generic {
16 public:
22 inline DSA(KeyPair::Generic::PointerType keypair):
23 Generic(Type::DSA, keypair) {}
24
30 inline DSA(const KeyPair::DSA& keypair):
31 Generic(Type::DSA, keypair) {}
32
38 inline DSA(KeyPair::DSA&& keypair):
39 Generic(Type::DSA, keypair) {}
40
45 DSA(const DSA& other) = default;
46
51 DSA(DSA&& other) noexcept = default;
52
56 ~DSA() noexcept = default;
57
63 DSA& operator=(const DSA& other) = default;
64
70 DSA& operator=(DSA&& other) noexcept = default;
71
76 PointerType Clone() const noexcept override {
77 return std::make_shared<DSA>(*this);
78 }
79
84 PointerType Move() noexcept override {
85 return std::make_shared<DSA>(std::move(*this));
86 }
87
88 private:
96 bool DoSign(std::span<const std::byte> input, Buffer::WriteOnly& output) const noexcept override;
97
104 Buffer::Consumer DoSign(Buffer::Consumer consumer, ReadMode mode) const noexcept override;
105
112 bool DoVerify(std::span<const std::byte> input, const std::string& signature) const noexcept override;
120 bool DoVerify(Buffer::Consumer consumer, const std::string& signature, ReadMode mode) const noexcept override;
121 };
122}
A DSA keypair class.
Definition dsa.hxx:14
A generic signer signer class.
Definition dsa.hxx:15
DSA(KeyPair::DSA &&keypair)
Constructor.
Definition dsa.hxx:38
~DSA() noexcept=default
Virtual destructor.
PointerType Move() noexcept override
Move the DSA signer.
Definition dsa.hxx:84
DSA(KeyPair::Generic::PointerType keypair)
Constructor.
Definition dsa.hxx:22
DSA(const KeyPair::DSA &keypair)
Constructor.
Definition dsa.hxx:30
DSA(const DSA &other)=default
Copy constructor.
DSA(DSA &&other) noexcept=default
Move constructor.
A generic signer class.
Definition generic.hxx:27