Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
dev::KeyPair Class Reference

Simple class that represents a "key pair". More...

#include <Common.h>

Collaboration diagram for dev::KeyPair:
[legend]

Public Member Functions

 KeyPair ()=default
 Null constructor. More...
 
 KeyPair (Secret const &_sec)
 Normal constructor - populates object from the given secret key. More...
 
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).

Definition at line 150 of file Common.h.

Constructor & Destructor Documentation

dev::KeyPair::KeyPair ( )
default

Null constructor.

Here is the caller graph for this function:

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 298 of file Common.cpp.

Here is the call graph for this function:

Member Function Documentation

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

Retrieve the associated address of the public key.

Definition at line 173 of file Common.h.

Here is the caller graph for this function:

KeyPair KeyPair::create ( )
static

Create a new, randomly generated object.

Definition at line 307 of file Common.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Create from an encrypted seed.

Definition at line 317 of file Common.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 176 of file Common.h.

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

Definition at line 175 of file Common.h.

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

Retrieve the public key.

Definition at line 170 of file Common.h.

Here is the caller graph for this function:

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

Definition at line 167 of file Common.h.

Here is the caller graph for this function:

Member Data Documentation

Address dev::KeyPair::m_address
private

Definition at line 181 of file Common.h.

Public dev::KeyPair::m_public
private

Definition at line 180 of file Common.h.

Secret dev::KeyPair::m_secret
private

Definition at line 179 of file Common.h.


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