Ethereum  PoC-8
The C++ Implementation of Ethereum
dev::KeyPair Class Reference

#include <Common.h>

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...
 

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).

Definition at line 148 of file Common.h.

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".

Definition at line 331 of file Common.cpp.

Member Function Documentation

◆ address()

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

Retrieve the associated address of the public key.

Definition at line 168 of file Common.h.

◆ create()

KeyPair KeyPair::create ( )
static

Create a new, randomly generated object.

Definition at line 340 of file Common.cpp.

◆ fromEncryptedSeed()

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

Create from an encrypted seed.

Definition at line 350 of file Common.cpp.

◆ operator!=()

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

Definition at line 171 of file Common.h.

◆ operator==()

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

Definition at line 170 of file Common.h.

◆ pub()

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

Retrieve the public key.

Definition at line 165 of file Common.h.

◆ secret()

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

Definition at line 162 of file Common.h.


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