An encapsulated public key.
More...
#include <pubkey.h>
|
| | CPubKey () |
| | Construct an invalid public key. More...
|
| |
| template<typename T > |
| void | Set (const T pbegin, const T pend) |
| | Initialize a public key using begin/end iterators to byte data. More...
|
| |
| template<typename T > |
| | CPubKey (const T pbegin, const T pend) |
| | Construct a public key using begin/end iterators to byte data. More...
|
| |
| | CPubKey (const std::vector< unsigned char > &vch) |
| | Construct a public key from a byte vector. More...
|
| |
| unsigned int | size () const |
| | Simple read-only vector-like interface to the pubkey data. More...
|
| |
| const unsigned char * | begin () const |
| |
| const unsigned char * | end () const |
| |
| const unsigned char & | operator[] (unsigned int pos) const |
| |
| unsigned int | GetSerializeSize (int nType, int nVersion) const |
| | Implement serialization, as if this was a byte vector. More...
|
| |
| template<typename Stream > |
| void | Serialize (Stream &s, int nType, int nVersion) const |
| |
| template<typename Stream > |
| void | Unserialize (Stream &s, int nType, int nVersion) |
| |
| CKeyID | GetID () const |
| | Get the KeyID of this public key (hash of its serialization) More...
|
| |
| uint256 | GetHash () const |
| | Get the 256-bit hash of this public key. More...
|
| |
| bool | IsValid () const |
| |
| bool | IsFullyValid () const |
| | fully validate whether this is a valid public key (more expensive than IsValid()) More...
|
| |
| bool | IsCompressed () const |
| | Check whether this is a compressed public key. More...
|
| |
| bool | Verify (const uint256 &hash, const std::vector< unsigned char > &vchSig) const |
| | Verify a DER signature (~72 bytes). More...
|
| |
| bool | RecoverCompact (const uint256 &hash, const std::vector< unsigned char > &vchSig) |
| | Recover a public key from a compact signature. More...
|
| |
| bool | Decompress () |
| | Turn this public key into an uncompressed public key. More...
|
| |
| bool | Derive (CPubKey &pubkeyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const |
| | Derive BIP32 child pubkey. More...
|
| |
| std::vector< unsigned char > | Raw () const |
| |
| std::string | GetHex () const |
| |
|
| unsigned static int | GetLen (unsigned char chHeader) |
| | Compute the length of a pubkey with a given first byte. More...
|
| |
|
| unsigned char | vch [65] |
| | Just store the serialized data. More...
|
| |
An encapsulated public key.
Definition at line 37 of file pubkey.h.
◆ CPubKey() [1/3]
Construct an invalid public key.
Definition at line 64 of file pubkey.h.
◆ CPubKey() [2/3]
template<typename T >
| CPubKey::CPubKey |
( |
const T |
pbegin, |
|
|
const T |
pend |
|
) |
| |
|
inline |
Construct a public key using begin/end iterators to byte data.
Definition at line 82 of file pubkey.h.
◆ CPubKey() [3/3]
| CPubKey::CPubKey |
( |
const std::vector< unsigned char > & |
vch | ) |
|
|
inline |
Construct a public key from a byte vector.
Definition at line 88 of file pubkey.h.
◆ begin()
| const unsigned char* CPubKey::begin |
( |
| ) |
const |
|
inline |
◆ Decompress()
| bool CPubKey::Decompress |
( |
| ) |
|
Turn this public key into an uncompressed public key.
Definition at line 69 of file pubkey.cpp.
◆ Derive()
| bool CPubKey::Derive |
( |
CPubKey & |
pubkeyChild, |
|
|
unsigned char |
ccChild[32], |
|
|
unsigned int |
nChild, |
|
|
const unsigned char |
cc[32] |
|
) |
| const |
Derive BIP32 child pubkey.
Definition at line 89 of file pubkey.cpp.
◆ end()
| const unsigned char* CPubKey::end |
( |
| ) |
const |
|
inline |
◆ GetHash()
Get the 256-bit hash of this public key.
Definition at line 149 of file pubkey.h.
◆ GetHex()
| std::string CPubKey::GetHex |
( |
| ) |
const |
|
inline |
◆ GetID()
| CKeyID CPubKey::GetID |
( |
| ) |
const |
|
inline |
Get the KeyID of this public key (hash of its serialization)
Definition at line 143 of file pubkey.h.
◆ GetLen()
| unsigned static int CPubKey::GetLen |
( |
unsigned char |
chHeader | ) |
|
|
inlinestaticprivate |
Compute the length of a pubkey with a given first byte.
Definition at line 47 of file pubkey.h.
◆ GetSerializeSize()
| unsigned int CPubKey::GetSerializeSize |
( |
int |
nType, |
|
|
int |
nVersion |
|
) |
| const |
|
inline |
Implement serialization, as if this was a byte vector.
Definition at line 116 of file pubkey.h.
◆ Invalidate()
| void CPubKey::Invalidate |
( |
| ) |
|
|
inlineprivate |
Set this key data to be invalid.
Definition at line 57 of file pubkey.h.
◆ IsCompressed()
| bool CPubKey::IsCompressed |
( |
| ) |
const |
|
inline |
Check whether this is a compressed public key.
Definition at line 168 of file pubkey.h.
◆ IsFullyValid()
| bool CPubKey::IsFullyValid |
( |
| ) |
const |
fully validate whether this is a valid public key (more expensive than IsValid())
Definition at line 54 of file pubkey.cpp.
◆ IsValid()
| bool CPubKey::IsValid |
( |
| ) |
const |
|
inline |
◆ operator[]()
| const unsigned char& CPubKey::operator[] |
( |
unsigned int |
pos | ) |
const |
|
inline |
◆ Raw()
| std::vector<unsigned char> CPubKey::Raw |
( |
| ) |
const |
|
inline |
◆ RecoverCompact()
| bool CPubKey::RecoverCompact |
( |
const uint256 & |
hash, |
|
|
const std::vector< unsigned char > & |
vchSig |
|
) |
| |
Recover a public key from a compact signature.
Definition at line 32 of file pubkey.cpp.
◆ Serialize()
template<typename Stream >
| void CPubKey::Serialize |
( |
Stream & |
s, |
|
|
int |
nType, |
|
|
int |
nVersion |
|
) |
| const |
|
inline |
◆ Set()
template<typename T >
| void CPubKey::Set |
( |
const T |
pbegin, |
|
|
const T |
pend |
|
) |
| |
|
inline |
Initialize a public key using begin/end iterators to byte data.
Definition at line 71 of file pubkey.h.
◆ size()
| unsigned int CPubKey::size |
( |
| ) |
const |
|
inline |
Simple read-only vector-like interface to the pubkey data.
Definition at line 94 of file pubkey.h.
◆ Unserialize()
template<typename Stream >
| void CPubKey::Unserialize |
( |
Stream & |
s, |
|
|
int |
nType, |
|
|
int |
nVersion |
|
) |
| |
|
inline |
◆ Verify()
| bool CPubKey::Verify |
( |
const uint256 & |
hash, |
|
|
const std::vector< unsigned char > & |
vchSig |
|
) |
| const |
Verify a DER signature (~72 bytes).
If this public key is not fully valid, the return value will be false.
Definition at line 15 of file pubkey.cpp.
◆ operator!=
◆ operator<
◆ operator==
Comparator implementation.
Definition at line 100 of file pubkey.h.
◆ vch
| unsigned char CPubKey::vch[65] |
|
private |
Just store the serialized data.
Its length can very cheaply be computed from the first byte.
Definition at line 44 of file pubkey.h.
The documentation for this class was generated from the following files: