StormByte C++ Library: Crypto module 1.0.0
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
crypter.hxx
1#pragma once
2
3#include <StormByte/buffer/consumer.hxx>
4#include <StormByte/crypto/algorithm.hxx>
5#include <StormByte/crypto/exception.hxx>
6#include <StormByte/expected.hxx>
7
8#include <string>
9
14namespace StormByte::Crypto {
21 class STORMBYTE_CRYPTO_PUBLIC Crypter {
22 public:
26 Crypter() noexcept = default;
27
32 Crypter(const Crypter& crypter) = default;
33
38 Crypter(Crypter&& crypter) noexcept = default;
39
43 virtual ~Crypter() noexcept = default;
44
50 Crypter& operator=(const Crypter& crypter) = default;
51
57 Crypter& operator=(Crypter&& crypter) noexcept = default;
58
64 [[nodiscard]]
65 virtual Expected<std::string, Exception> Encrypt(const std::string& input) const noexcept = 0;
66
72 [[nodiscard]]
73 virtual Expected<Buffer::Simple, Exception> Encrypt(const Buffer::Simple& buffer) const noexcept = 0;
74
80 [[nodiscard]]
81 virtual Buffer::Consumer Encrypt(const Buffer::Consumer consumer) const noexcept = 0;
82
88 [[nodiscard]]
89 virtual Expected<std::string, Exception> Decrypt(const std::string& input) const noexcept = 0;
90
96 [[nodiscard]]
97 virtual Expected<Buffer::Simple, Exception> Decrypt(const Buffer::Simple& buffer) const noexcept = 0;
98
104 [[nodiscard]]
105 virtual Buffer::Consumer Decrypt(const Buffer::Consumer consumer) const noexcept = 0;
106 };
107}
An abstract base class for encryption and decryption operations.
Definition crypter.hxx:21
Crypter() noexcept=default
Default constructor for the Crypter class.
A class representing an exception in the crypto module.
Definition exception.hxx:15