Secure container for named passwords.
More...
#include <vault.hxx>
|
|
| Vault ()=default |
| | Default constructor. Creates an empty vault.
|
| |
|
| Vault (const Vault &)=delete |
| | Copy constructor (deleted). Copying is disabled to prevent accidental duplication of the vault.
|
| |
| | Vault (Vault &&other) noexcept |
| | Move constructor.
|
| |
|
| ~Vault () noexcept |
| | Destructor. Releases all stored passwords (secure wipe is performed by Password).
|
| |
|
Vault & | operator= (const Vault &)=delete |
| | Copy assignment operator (deleted).
|
| |
| Vault & | operator= (Vault &&other) noexcept |
| | Move assignment operator.
|
| |
| void | Store (std::string name, Password password) noexcept |
| | Store (or overwrite) a named password.
|
| |
| ExpectedPassword | Get (const std::string &name) const noexcept |
| | Retrieve a password by name.
|
| |
| bool | Contains (const std::string &name) const noexcept |
| | Check whether a named password exists.
|
| |
| void | Remove (const std::string &name) noexcept |
| | Remove a named password.
|
| |
|
void | Clear () noexcept |
| | Remove all stored passwords.
|
| |
| std::size_t | Size () const noexcept |
| | Get the number of stored passwords.
|
| |
| bool | Empty () const noexcept |
| | Check whether the vault is empty.
|
| |
Secure container for named passwords.
Owns a collection of Password objects and automatically releases them (triggering secure wipe) on destruction or when Clear() / Remove() is called. The class is non-copyable and only movable.
◆ Vault()
| StormByte::Crypto::Vault::Vault |
( |
Vault && |
other | ) |
|
|
noexcept |
Move constructor.
- Parameters
-
| other | The vault to move from. |
◆ Contains()
| bool StormByte::Crypto::Vault::Contains |
( |
const std::string & |
name | ) |
const |
|
noexcept |
Check whether a named password exists.
- Parameters
-
| name | Identifier to look for. |
- Returns
- true if the password exists, false otherwise.
◆ Empty()
| bool StormByte::Crypto::Vault::Empty |
( |
| ) |
const |
|
noexcept |
Check whether the vault is empty.
- Returns
- true if no passwords are stored, false otherwise.
◆ Get()
| ExpectedPassword StormByte::Crypto::Vault::Get |
( |
const std::string & |
name | ) |
const |
|
noexcept |
Retrieve a password by name.
- Parameters
-
| name | Identifier of the password to retrieve. |
- Returns
- Expected containing a Password on success, or an error if the name does not exist.
- Note
- The returned Password shares ownership of the underlying data (cheap copy).
◆ operator=()
| Vault & StormByte::Crypto::Vault::operator= |
( |
Vault && |
other | ) |
|
|
noexcept |
Move assignment operator.
- Parameters
-
| other | The vault to move from. |
- Returns
- Reference to this vault.
◆ Remove()
| void StormByte::Crypto::Vault::Remove |
( |
const std::string & |
name | ) |
|
|
noexcept |
Remove a named password.
- Parameters
-
| name | Identifier of the password to remove. |
◆ Size()
| std::size_t StormByte::Crypto::Vault::Size |
( |
| ) |
const |
|
noexcept |
Get the number of stored passwords.
- Returns
- The number of passwords currently stored in the vault.
◆ Store()
| void StormByte::Crypto::Vault::Store |
( |
std::string |
name, |
|
|
Password |
password |
|
) |
| |
|
noexcept |
Store (or overwrite) a named password.
- Parameters
-
| name | Identifier for the password. |
| password | The password to store (copied / shared). |
The documentation for this class was generated from the following file:
- /home/runner/work/StormByte-Crypto/StormByte-Crypto/lib/public/StormByte/crypto/vault.hxx