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 | Protected Member Functions | Protected Attributes | List of all members
StormByte::Crypto::Secret::Generic Class Referenceabstract

A generic secret class. More...

#include <generic.hxx>

Inheritance diagram for StormByte::Crypto::Secret::Generic:
Inheritance graph
[legend]
Collaboration diagram for StormByte::Crypto::Secret::Generic:
Collaboration graph
[legend]

Public Member Functions

 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.
 
KeyPair::Generic::PointerType KeyPair () const noexcept
 Gets the keypair used for secret sharing.
 
enum Type Type () const noexcept
 Gets the type of the secret share generator used for secret sharing.
 
std::optional< std::string > Share (const std::string &peerPublicKey) const noexcept
 Shares the secret with a peer using their public key.
 

Protected Member Functions

 Generic (enum Type type, KeyPair::Generic::PointerType keypair)
 Constructor.
 
 Generic (enum Type type, const KeyPair::Generic &keypair)
 Constructor.
 
 Generic (enum Type type, KeyPair::Generic &&keypair)
 Constructor.
 

Protected Attributes

enum Type m_type
 The type of secret generator.
 
KeyPair::Generic::PointerType m_keypair
 The keypair used for secret sharing.
 

Detailed Description

A generic secret class.

Constructor & Destructor Documentation

◆ Generic() [1/5]

StormByte::Crypto::Secret::Generic::Generic ( const Generic other)
default

Copy constructor.

Parameters
otherThe other Generic secret to copy from.

◆ Generic() [2/5]

StormByte::Crypto::Secret::Generic::Generic ( Generic &&  other)
defaultnoexcept

Move constructor.

Parameters
otherThe other Generic secret to move from.

◆ Generic() [3/5]

StormByte::Crypto::Secret::Generic::Generic ( enum Type  type,
KeyPair::Generic::PointerType  keypair 
)
inlineprotected

Constructor.

Parameters
keypairThe keypair used for secret sharing.

◆ Generic() [4/5]

StormByte::Crypto::Secret::Generic::Generic ( enum Type  type,
const KeyPair::Generic keypair 
)
inlineprotected

Constructor.

Parameters
keypairThe keypair used for secret sharing.

◆ Generic() [5/5]

StormByte::Crypto::Secret::Generic::Generic ( enum Type  type,
KeyPair::Generic &&  keypair 
)
inlineprotected

Constructor.

Parameters
keypairThe keypair used for secret sharing.

Member Function Documentation

◆ KeyPair()

KeyPair::Generic::PointerType StormByte::Crypto::Secret::Generic::KeyPair ( ) const
inlinenoexcept

Gets the keypair used for secret sharing.

Returns
The keypair.

◆ operator=() [1/2]

Generic & StormByte::Crypto::Secret::Generic::operator= ( const Generic other)
default

Copy assignment operator.

Parameters
otherThe other Generic secret to copy from.
Returns
Reference to this Generic secret.

◆ operator=() [2/2]

Generic & StormByte::Crypto::Secret::Generic::operator= ( Generic &&  other)
defaultnoexcept

Move assignment operator.

Parameters
otherThe other Generic secret to move from.
Returns
Reference to this Generic secret.

◆ Share()

std::optional< std::string > StormByte::Crypto::Secret::Generic::Share ( const std::string &  peerPublicKey) const
inlinenoexcept

Shares the secret with a peer using their public key.

Parameters
peerPublicKeyThe peer's public key.
Returns
An optional string containing the shared secret, or std::nullopt on failure.

◆ Type()

enum Type StormByte::Crypto::Secret::Generic::Type ( ) const
inlinenoexcept

Gets the type of the secret share generator used for secret sharing.

Returns
The type of the secret share generator.

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