3#include <StormByte/crypto/visibility.h>
10namespace StormByte::Crypto::Helpers {
12 struct PasswordAccess;
19namespace StormByte::Crypto {
55 Password(
const void* data, std::size_t size)
noexcept;
93 std::size_t
Size() const noexcept;
99 bool Empty() const noexcept;
105 explicit operator
bool() const noexcept;
112 bool operator==(const
Password& other) const noexcept;
119 bool operator!=(const
Password& other) const noexcept;
122 friend struct Helpers::PasswordAccess;
124 std::shared_ptr<Helpers::SecureContent> m_data;
Secure, reference-counted container for passwords and binary key material.
Definition password.hxx:36
Password & operator=(Password &&other) noexcept=default
Move assignment operator.
Password(Password &&other) noexcept=default
Move constructor.
Password(const void *data, std::size_t size) noexcept
Construct from raw bytes (exact size, no null terminator added).
Password(const Password &other)=default
Copy constructor.
std::size_t Size() const noexcept
Length of the stored material in bytes.
Password & operator=(const Password &other)=default
Copy assignment operator.
~Password()=default
Destructor. Wipes the underlying buffer when this is the last owner.
Password(std::string value) noexcept
Construct from a std::string (copied byte-for-byte, then wiped).
Password(const char *value) noexcept
Construct from a C string (copied byte-for-byte up to the terminator).