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