TARAXA
dev::KeyPair Class Reference

#include <Common.h>

Collaboration diagram for dev::KeyPair:

Public Member Functions

 KeyPair (Secret const &_sec)
 
Secret const & secret () const
 
Public const & pub () const
 Retrieve the public key. More...
 
Address const & address () const
 Retrieve the associated address of the public key. More...
 
bool operator== (KeyPair const &_c) const
 
bool operator!= (KeyPair const &_c) const
 

Static Public Member Functions

static KeyPair create ()
 Create a new, randomly generated object. More...
 
static KeyPair fromEncryptedSeed (bytesConstRef _seed, std::string const &_password)
 Create from an encrypted seed. More...
 

Private Attributes

Secret m_secret
 
Public m_public
 
Address m_address
 

Detailed Description

Simple class that represents a "key pair". All of the data of the class can be regenerated from the secret key (m_secret) alone. Actually stores a tuplet of secret, public and address (the right 160-bits of the public).

Constructor & Destructor Documentation

◆ KeyPair()

KeyPair::KeyPair ( Secret const &  _sec)

Normal constructor - populates object from the given secret key. If the secret key is invalid the constructor succeeds, but public key and address stay "null".

Member Function Documentation

◆ address()

Address const& dev::KeyPair::address ( ) const
inline

Retrieve the associated address of the public key.

◆ create()

KeyPair KeyPair::create ( )
static

Create a new, randomly generated object.

◆ fromEncryptedSeed()

KeyPair KeyPair::fromEncryptedSeed ( bytesConstRef  _seed,
std::string const &  _password 
)
static

Create from an encrypted seed.

◆ operator!=()

bool dev::KeyPair::operator!= ( KeyPair const &  _c) const
inline

◆ operator==()

bool dev::KeyPair::operator== ( KeyPair const &  _c) const
inline

◆ pub()

Public const& dev::KeyPair::pub ( ) const
inline

Retrieve the public key.

◆ secret()

Secret const& dev::KeyPair::secret ( ) const
inline

Member Data Documentation

◆ m_address

Address dev::KeyPair::m_address
private

◆ m_public

Public dev::KeyPair::m_public
private

◆ m_secret

Secret dev::KeyPair::m_secret
private

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