StormByte C++ Library: Crypto module 1.0.0
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
Public Member Functions | List of all members
StormByte::Crypto::Crypter Class Referenceabstract

An abstract base class for encryption and decryption operations. More...

#include <crypter.hxx>

Inheritance diagram for StormByte::Crypto::Crypter:
Inheritance graph
[legend]

Public Member Functions

 Crypter () noexcept=default
 Default constructor for the Crypter class.
 
 Crypter (const Crypter &crypter)=default
 Copy constructor for the Crypter class.
 
 Crypter (Crypter &&crypter) noexcept=default
 Move constructor for the Crypter class.
 
virtual ~Crypter () noexcept=default
 Virtual destructor for the Crypter class.
 
Crypteroperator= (const Crypter &crypter)=default
 Copy assignment operator for the Crypter class.
 
Crypteroperator= (Crypter &&crypter) noexcept=default
 Move assignment operator for the Crypter class.
 
virtual Expected< std::string, ExceptionEncrypt (const std::string &input) const noexcept=0
 Encrypts a string input.
 
virtual Expected< Buffer::Simple, ExceptionEncrypt (const Buffer::Simple &buffer) const noexcept=0
 Encrypts a buffer.
 
virtual Buffer::Consumer Encrypt (const Buffer::Consumer consumer) const noexcept=0
 Encrypts data asynchronously using a Consumer/Producer model.
 
virtual Expected< std::string, ExceptionDecrypt (const std::string &input) const noexcept=0
 Decrypts a string input.
 
virtual Expected< Buffer::Simple, ExceptionDecrypt (const Buffer::Simple &buffer) const noexcept=0
 Decrypts a buffer.
 
virtual Buffer::Consumer Decrypt (const Buffer::Consumer consumer) const noexcept=0
 Decrypts data asynchronously using a Consumer/Producer model.
 

Detailed Description

An abstract base class for encryption and decryption operations.

This class defines the interface for encrypting and decrypting data using various cryptographic algorithms.

Constructor & Destructor Documentation

◆ Crypter() [1/2]

StormByte::Crypto::Crypter::Crypter ( const Crypter crypter)
default

Copy constructor for the Crypter class.

Parameters
crypterThe Crypter instance to copy.

◆ Crypter() [2/2]

StormByte::Crypto::Crypter::Crypter ( Crypter &&  crypter)
defaultnoexcept

Move constructor for the Crypter class.

Parameters
crypterThe Crypter instance to move.

Member Function Documentation

◆ Decrypt() [1/3]

virtual Buffer::Consumer StormByte::Crypto::Crypter::Decrypt ( const Buffer::Consumer  consumer) const
pure virtualnoexcept

Decrypts data asynchronously using a Consumer/Producer model.

Parameters
consumerThe Consumer buffer containing the encrypted data.
Returns
A Consumer buffer containing the decrypted data.

Implemented in StormByte::Crypto::Asymmetric, and StormByte::Crypto::Symmetric.

◆ Decrypt() [2/3]

virtual Expected< Buffer::Simple, Exception > StormByte::Crypto::Crypter::Decrypt ( const Buffer::Simple &  buffer) const
pure virtualnoexcept

Decrypts a buffer.

Parameters
bufferThe buffer to decrypt.
Returns
An Expected containing the decrypted buffer or an error.

Implemented in StormByte::Crypto::Asymmetric, and StormByte::Crypto::Symmetric.

◆ Decrypt() [3/3]

virtual Expected< std::string, Exception > StormByte::Crypto::Crypter::Decrypt ( const std::string &  input) const
pure virtualnoexcept

Decrypts a string input.

Parameters
inputThe string to decrypt.
Returns
An Expected containing the decrypted string or an error.

Implemented in StormByte::Crypto::Asymmetric, and StormByte::Crypto::Symmetric.

◆ Encrypt() [1/3]

virtual Buffer::Consumer StormByte::Crypto::Crypter::Encrypt ( const Buffer::Consumer  consumer) const
pure virtualnoexcept

Encrypts data asynchronously using a Consumer/Producer model.

Parameters
consumerThe Consumer buffer containing the input data.
Returns
A Consumer buffer containing the encrypted data.

Implemented in StormByte::Crypto::Asymmetric, and StormByte::Crypto::Symmetric.

◆ Encrypt() [2/3]

virtual Expected< Buffer::Simple, Exception > StormByte::Crypto::Crypter::Encrypt ( const Buffer::Simple &  buffer) const
pure virtualnoexcept

Encrypts a buffer.

Parameters
bufferThe buffer to encrypt.
Returns
An Expected containing the encrypted buffer or an error.

Implemented in StormByte::Crypto::Asymmetric, and StormByte::Crypto::Symmetric.

◆ Encrypt() [3/3]

virtual Expected< std::string, Exception > StormByte::Crypto::Crypter::Encrypt ( const std::string &  input) const
pure virtualnoexcept

Encrypts a string input.

Parameters
inputThe string to encrypt.
Returns
An Expected containing the encrypted string or an error.

Implemented in StormByte::Crypto::Asymmetric, and StormByte::Crypto::Symmetric.

◆ operator=() [1/2]

Crypter & StormByte::Crypto::Crypter::operator= ( const Crypter crypter)
default

Copy assignment operator for the Crypter class.

Parameters
crypterThe Crypter instance to copy.
Returns
A reference to the updated Crypter instance.

◆ operator=() [2/2]

Crypter & StormByte::Crypto::Crypter::operator= ( Crypter &&  crypter)
defaultnoexcept

Move assignment operator for the Crypter class.

Parameters
crypterThe Crypter instance to move.
Returns
A reference to the updated Crypter instance.

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