Ring Daemon 16.0.0
|
Simple class that represents a "key pair". More...
#include <Common.h>
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. | |
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.
|
default |
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().
|
inline |
Retrieve the associated address of the public key.
Definition at line 100 of file libdevcrypto/Common.h.
Referenced by create().
|
static |
Create a new, randomly generated object.
Definition at line 99 of file Common.cpp.
References address(), and dev::SecureFixedHash< 32 >::random().
|
inline |
Definition at line 103 of file libdevcrypto/Common.h.
|
inline |
Definition at line 102 of file libdevcrypto/Common.h.
|
inline |
Retrieve the public key.
Definition at line 97 of file libdevcrypto/Common.h.
|
inline |
Create from an encrypted seed.
Definition at line 94 of file libdevcrypto/Common.h.