Electroneum
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
tools::password_container Class Reference

#include <password.h>

Collaboration diagram for tools::password_container:
Collaboration graph
[legend]

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

static constexpr const size_t max_password_size = 1024
 

Private Attributes

std::string m_password
 TODO Custom allocator that locks to RAM? More...
 

Constructor & Destructor Documentation

◆ password_container() [1/4]

tools::password_container::password_container ( )
noexcept

Empty password.

◆ password_container() [2/4]

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

password is used as password

◆ password_container() [3/4]

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

◆ password_container() [4/4]

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 std::string& tools::password_container::password ( ) const
inlinenoexcept

◆ prompt()

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

Member Data Documentation

◆ m_password

std::string tools::password_container::m_password
private

TODO Custom allocator that locks to RAM?

◆ max_password_size

constexpr const size_t tools::password_container::max_password_size = 1024
static

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