StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
ed25519.hxx
1#pragma once
2
3#include <StormByte/crypto/keypair/generic.hxx>
4
9namespace StormByte::Crypto::KeyPair {
14 class STORMBYTE_CRYPTO_PUBLIC ED25519 final: public Generic {
15 public:
21 inline ED25519(const std::string& public_key, std::optional<std::string> private_key = std::nullopt):
22 Generic(Type::ED25519, public_key, private_key) {}
23
28 ED25519(const ED25519& other) = default;
29
34 ED25519(ED25519&& other) noexcept = default;
35
39 ~ED25519() noexcept = default;
40
46 ED25519& operator=(const ED25519& other) = default;
47
53 ED25519& operator=(ED25519&& other) noexcept = default;
54
59 PointerType Clone() const noexcept override {
60 return std::make_shared<ED25519>(*this);
61 }
62
67 PointerType Move() noexcept override {
68 return std::make_shared<ED25519>(std::move(*this));
69 }
70
76 static PointerType Generate(unsigned short key_size = 256) noexcept;
77 };
78}
An ED25519 keypair class.
Definition ed25519.hxx:14
ED25519(const ED25519 &other)=default
Copy constructor.
ED25519(const std::string &public_key, std::optional< std::string > private_key=std::nullopt)
Constructor.
Definition ed25519.hxx:21
ED25519(ED25519 &&other) noexcept=default
Move constructor.
~ED25519() noexcept=default
Destructor.
static PointerType Generate(unsigned short key_size=256) noexcept
Generates a new ED25519 keypair.
PointerType Move() noexcept override
Move the ED25519 keypair.
Definition ed25519.hxx:67
A generic class.
Definition generic.hxx:34