Ring Daemon 16.0.0
Loading...
Searching...
No Matches
dev::KeyPair Class Reference

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

#include <Common.h>

Collaboration diagram for dev::KeyPair:
Collaboration graph

Public Member Functions

Address const & address () const
 Retrieve the associated address of the public key.
 
 KeyPair ()=default
 
 KeyPair (Secret const &_sec)
 Normal constructor - populates object from the given secret key.
 
bool operator!= (KeyPair const &_c) const
 
bool operator== (KeyPair const &_c) const
 
Public const & pub () const
 Retrieve the public key.
 
Secret const & secret () const
 Create from an encrypted seed.
 

Static Public Member Functions

static KeyPair create ()
 Create a new, randomly generated object.
 

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 79 of file libdevcrypto/Common.h.

Constructor & Destructor Documentation

◆ KeyPair() [1/2]

dev::KeyPair::KeyPair ( )
default

◆ KeyPair() [2/2]

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

References dev::toAddress().

Here is the call graph for this function:

Member Function Documentation

◆ address()

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

Retrieve the associated address of the public key.

Definition at line 100 of file libdevcrypto/Common.h.

Referenced by create().

◆ create()

KeyPair KeyPair::create ( )
static

Create a new, randomly generated object.

Definition at line 99 of file Common.cpp.

References address(), and dev::SecureFixedHash< 32 >::random().

Here is the call graph for this function:

◆ operator!=()

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

Definition at line 103 of file libdevcrypto/Common.h.

◆ operator==()

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

Definition at line 102 of file libdevcrypto/Common.h.

◆ pub()

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

Retrieve the public key.

Definition at line 97 of file libdevcrypto/Common.h.

◆ secret()

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

Create from an encrypted seed.

Definition at line 94 of file libdevcrypto/Common.h.


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