StormByte C++ Library: Crypto module 0.0.9999
StormByte-Crypto is a StormByte library module for handling cryptographic operations
Loading...
Searching...
No Matches
generic.hxx
1#pragma once
2
3#include <StormByte/crypto/crypter/generic.hxx>
4
5#include <string>
6
11namespace StormByte::Crypto::Crypter {
16 class STORMBYTE_CRYPTO_PUBLIC Symmetric: public Generic {
17 public:
22 Symmetric(const Symmetric& other) = default;
23
28 Symmetric(Symmetric&& other) noexcept = default;
29
33 virtual ~Symmetric() noexcept = default;
34
40 Symmetric& operator=(const Symmetric& other) = default;
41
47 Symmetric& operator=(Symmetric&& other) noexcept = default;
48
53 inline const std::string& Password() const noexcept {
54 return m_password;
55 }
56
62 static std::string RandomPassword(size_t length = 32) noexcept;
63
64 protected:
65 std::string m_password;
66
71 inline Symmetric(enum Type type, const std::string& password):
72 Generic(type), m_password(password) {}
73 };
74
81 STORMBYTE_CRYPTO_PUBLIC Generic::PointerType Create(enum Type type, const std::string& password) noexcept;
82}
A generic crypter class.
Definition generic.hxx:32
A generic symmetric crypter class.
Definition generic.hxx:16
Symmetric(Symmetric &&other) noexcept=default
Move constructor.
Symmetric(const Symmetric &other)=default
Copy constructor.
virtual ~Symmetric() noexcept=default
Virtual destructor.
static std::string RandomPassword(size_t length=32) noexcept
Generates a random password for symmetric encryption.