Monero
Loading...
Searching...
No Matches
tools::password_container Class Reference

#include <password.h>

Collaboration diagram for tools::password_container:

Public Member Functions

 password_container () noexcept
 Empty password.
 password_container (std::string &&password) noexcept
 password is used as password
 password_container (const epee::wipeable_string &password) noexcept
 password_container (const password_container &)=delete
 password_container (password_container &&rhs)=default
 ~password_container () noexcept
 Wipes internal password.
password_containeroperator= (const password_container &)=delete
password_containeroperator= (password_container &&)=default
const epee::wipeable_stringpassword () const noexcept

Static Public Member Functions

static boost::optional< password_containerprompt (bool verify, const char *mesage="Password", bool hide_input=true)

Static Public Attributes

static constexpr const size_t max_password_size = 1024
static std::atomic< bool > is_prompting

Private Attributes

epee::wipeable_string m_password

Constructor & Destructor Documentation

◆ password_container() [1/5]

tools::password_container::password_container ( )
noexcept

Empty password.

◆ password_container() [2/5]

tools::password_container::password_container ( std::string && password)
noexcept

password is used as password

◆ password_container() [3/5]

tools::password_container::password_container ( const epee::wipeable_string & password)
noexcept

◆ password_container() [4/5]

tools::password_container::password_container ( const password_container & )
delete

◆ password_container() [5/5]

tools::password_container::password_container ( password_container && rhs)
default

◆ ~password_container()

tools::password_container::~password_container ( )
noexcept

Wipes internal password.

Member Function Documentation

◆ operator=() [1/2]

password_container & tools::password_container::operator= ( const password_container & )
delete

◆ operator=() [2/2]

password_container & tools::password_container::operator= ( password_container && )
default

◆ password()

const epee::wipeable_string & tools::password_container::password ( ) const
inlinenoexcept

◆ prompt()

boost::optional< password_container > tools::password_container::prompt ( bool verify,
const char * mesage = "Password",
bool hide_input = true )
static
Returns
A password from stdin TTY prompt or std::cin pipe.

Member Data Documentation

◆ is_prompting

std::atomic< bool > tools::password_container::is_prompting
static

◆ m_password

epee::wipeable_string tools::password_container::m_password
private

◆ max_password_size

const size_t tools::password_container::max_password_size = 1024
staticconstexpr

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