StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
StormByte::Crypto::KeyPair::ECDH Class Referencefinal

A ECDH keypair class. More...

#include <ecdh.hxx>

Inheritance diagram for StormByte::Crypto::KeyPair::ECDH:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Crypto::KeyPair::ECDH:
Collaboration graph
[legend]

Public Member Functions

 ECDH (const std::string &public_key, std::optional< std::string > private_key=std::nullopt)
 Constructor.
 
 ECDH (const ECDH &other)=default
 Copy constructor.
 
 ECDH (ECDH &&other) noexcept=default
 Move constructor.
 
 ~ECDH () noexcept=default
 Virtual destructor.
 
ECDHoperator= (const ECDH &other)=default
 Copy assignment operator.
 
ECDHoperator= (ECDH &&other) noexcept=default
 Move assignment operator.
 
PointerType Clone () const noexcept override
 Clone the ECDH keypair.
 
PointerType Move () noexcept override
 Move the ECDH keypair.
 
- Public Member Functions inherited from StormByte::Crypto::KeyPair::Generic
 Generic (const Generic &other)=default
 Copy constructor.
 
 Generic (Generic &&other) noexcept=default
 Move constructor.
 
virtual ~Generic () noexcept=default
 Virtual destructor.
 
Genericoperator= (const Generic &other)=default
 Copy assignment operator.
 
Genericoperator= (Generic &&other) noexcept=default
 Move assignment operator.
 
const std::string & PublicKey () const noexcept
 Gets the type of keypair.
 
const std::optional< std::string > & PrivateKey () const noexcept
 Gets the private key of the keypair.
 
enum Type Type () const noexcept
 Gets the type of keypair.
 
bool Save (const std::filesystem::path &path, const std::string &name) const noexcept
 Saves the keypair to the specified file paths.
 

Static Public Member Functions

static PointerType Generate (unsigned short key_size=2048) noexcept
 Generate a new ECDH keypair.
 

Additional Inherited Members

- Protected Member Functions inherited from StormByte::Crypto::KeyPair::Generic
 Generic (enum Type type, const std::string &public_key, std::optional< std::string > private_key=std::nullopt)
 Constructor.
 
- Protected Attributes inherited from StormByte::Crypto::KeyPair::Generic
enum Type m_type
 The type of keypair.
 
std::string m_public_key
 The public key.
 
std::optional< std::string > m_private_key
 The private key.
 

Detailed Description

A ECDH keypair class.

Constructor & Destructor Documentation

◆ ECDH() [1/3]

StormByte::Crypto::KeyPair::ECDH::ECDH ( const std::string &  public_key,
std::optional< std::string >  private_key = std::nullopt 
)
inline

Constructor.

Parameters
public_keyThe public key.
private_keyThe private key (optional).

◆ ECDH() [2/3]

StormByte::Crypto::KeyPair::ECDH::ECDH ( const ECDH other)
default

Copy constructor.

Parameters
otherThe other ECDH keypair to copy from.

◆ ECDH() [3/3]

StormByte::Crypto::KeyPair::ECDH::ECDH ( ECDH &&  other)
defaultnoexcept

Move constructor.

Parameters
otherThe other ECDH keypair to move from.

Member Function Documentation

◆ Clone()

PointerType StormByte::Crypto::KeyPair::ECDH::Clone ( ) const
inlineoverridenoexcept

Clone the ECDH keypair.

Returns
A pointer to the cloned ECDH keypair.

◆ Generate()

static PointerType StormByte::Crypto::KeyPair::ECDH::Generate ( unsigned short  key_size = 2048)
staticnoexcept

Generate a new ECDH keypair.

Parameters
key_sizeThe size of the key in bits.
Returns
A pointer to the generated ECDH keypair.

◆ Move()

PointerType StormByte::Crypto::KeyPair::ECDH::Move ( )
inlineoverridenoexcept

Move the ECDH keypair.

Returns
A pointer to the moved ECDH keypair.

◆ operator=() [1/2]

ECDH & StormByte::Crypto::KeyPair::ECDH::operator= ( const ECDH other)
default

Copy assignment operator.

Parameters
otherThe other ECDH keypair to copy from.
Returns
Reference to this ECDH keypair.

◆ operator=() [2/2]

ECDH & StormByte::Crypto::KeyPair::ECDH::operator= ( ECDH &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherThe other ECDH keypair to move from.
Returns
Reference to this ECDH keypair.

The documentation for this class was generated from the following file: