StormByte C++ Library: Crypto module 1.0.0
StormByte-Crypto is a StormByte library module for handling cryptographic operations
|
A class for managing shared secret operations. More...
#include <secret.hxx>
Public Member Functions | |
Secret (const Algorithm::SecretShare &algorithm, const KeyPair &key_pair) noexcept | |
Constructs a Secret instance with an algorithm and a key pair. | |
Secret (const Algorithm::SecretShare &algorithm, KeyPair &&key_pair) noexcept | |
Constructs a Secret instance with an algorithm and a key pair (move version). | |
Secret (const Secret &secret)=default | |
Copy constructor for the Secret class. | |
Secret (Secret &&secret) noexcept=default | |
Move constructor for the Secret class. | |
~Secret () noexcept=default | |
Destructor for the Secret class. | |
Secret & | operator= (const Secret &secret)=default |
Copy assignment operator for the Secret class. | |
Secret & | operator= (Secret &&secret) noexcept=default |
Move assignment operator for the Secret class. | |
void | PeerPublicKey (const std::string &peer_public_key) noexcept |
Sets the peer's public key for shared secret derivation. | |
Expected< std::string, Exception > | Content () const noexcept |
Derives the shared secret using the private key and the peer's public key. | |
const KeyPair & | KeyPair () const noexcept |
Returns the key pair associated with this Secret instance. | |
A class for managing shared secret operations.
This class provides methods for generating key pairs and deriving shared secrets using various secret-sharing algorithms (e.g., ECDH).
|
explicitnoexcept |
Constructs a Secret instance with an algorithm and a key pair.
This constructor initializes the Secret
instance with the specified secret-sharing algorithm and a key pair. The key pair is used for deriving shared secrets.
algorithm | The secret-sharing algorithm to use. |
key_pair | The key pair to use for shared secret operations. |
|
explicitnoexcept |
Constructs a Secret instance with an algorithm and a key pair (move version).
This constructor initializes the Secret
instance with the specified secret-sharing algorithm and a key pair. The key pair is moved into the instance to avoid unnecessary copying.
algorithm | The secret-sharing algorithm to use. |
key_pair | The key pair to use for shared secret operations (rvalue reference). |
|
default |
|
defaultnoexcept |
|
defaultnoexcept |
|
noexcept |
Derives the shared secret using the private key and the peer's public key.
This method derives the shared secret by combining the private key of the local key pair with the public key of the peer. The derived shared secret can be used for secure communication.
|
noexcept |
|
noexcept |
Sets the peer's public key for shared secret derivation.
This method sets the public key of the peer, which is required for deriving the shared secret.
peer_public_key | The public key of the peer. |