Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
CPubKey Class Reference

An encapsulated public key. More...

#include <key.h>

+ Collaboration diagram for CPubKey:

Public Member Functions

 CPubKey ()
 
template<typename T >
void Set (const T pbegin, const T pend)
 
template<typename T >
 CPubKey (const T pbegin, const T pend)
 
 CPubKey (const std::vector< unsigned char > &vch)
 
unsigned int size () const
 
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
 
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
 
uint256 GetHash () const
 
bool IsValid () const
 
bool IsFullyValid () const
 
bool IsCompressed () const
 
bool Verify (const uint256 &hash, const std::vector< unsigned char > &vchSig) const
 
bool VerifyCompact (const uint256 &hash, const std::vector< unsigned char > &vchSig) const
 
bool RecoverCompact (const uint256 &hash, const std::vector< unsigned char > &vchSig)
 
bool Decompress ()
 
bool Derive (CPubKey &pubkeyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const
 

Private Member Functions

void Invalidate ()
 

Static Private Member Functions

unsigned static int GetLen (unsigned char chHeader)
 

Private Attributes

unsigned char vch [65]
 

Friends

bool operator== (const CPubKey &a, const CPubKey &b)
 
bool operator!= (const CPubKey &a, const CPubKey &b)
 
bool operator< (const CPubKey &a, const CPubKey &b)
 

Detailed Description

An encapsulated public key.

Definition at line 42 of file key.h.

Constructor & Destructor Documentation

CPubKey::CPubKey ( )
inline

Definition at line 64 of file key.h.

References Invalidate().

+ Here is the call graph for this function:

template<typename T >
CPubKey::CPubKey ( const T  pbegin,
const T  pend 
)
inline

Definition at line 80 of file key.h.

References Set().

+ Here is the call graph for this function:

CPubKey::CPubKey ( const std::vector< unsigned char > &  vch)
inline

Definition at line 85 of file key.h.

References Set().

+ Here is the call graph for this function:

Member Function Documentation

const unsigned char* CPubKey::begin ( ) const
inline

Definition at line 91 of file key.h.

References vch.

Referenced by mastercore::ClassB_send(), CScriptCompressor::Decompress(), Derive(), CKey::Derive(), CExtPubKey::Encode(), CScript::operator<<(), and CWalletDB::WriteKey().

+ Here is the caller graph for this function:

bool CPubKey::Decompress ( )

Definition at line 482 of file key.cpp.

References IsValid().

Referenced by CScriptCompressor::Decompress().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CPubKey::Derive ( CPubKey pubkeyChild,
unsigned char  ccChild[32],
unsigned int  nChild,
const unsigned char  cc[32] 
) const

Definition at line 527 of file key.cpp.

References begin(), BIP32Hash(), end(), IsValid(), and memcpy().

Referenced by CExtPubKey::Derive().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const unsigned char* CPubKey::end ( ) const
inline

Definition at line 92 of file key.h.

References size().

Referenced by mastercore::ClassB_send(), Derive(), CKey::Derive(), CScript::operator<<(), and CWalletDB::WriteKey().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

uint256 CPubKey::GetHash ( ) const
inline

Definition at line 136 of file key.h.

References Hash(), and size().

Referenced by CCryptoKeyStore::AddKeyPubKey(), CCryptoKeyStore::EncryptKeys(), CCryptoKeyStore::GetKey(), and CCryptoKeyStore::Unlock().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CKeyID CPubKey::GetID ( ) const
inline

Definition at line 131 of file key.h.

References Hash160(), and size().

Referenced by CCryptoKeyStore::AddCryptedKey(), CWallet::AddCryptedKey(), CBasicKeyStore::AddKeyPubKey(), CWallet::AddKeyPubKey(), AddressTableModel::addRow(), AppInit2(), CExtPubKey::Derive(), CExtKey::Derive(), ExtractDestination(), ExtractDestinations(), PaymentServer::fetchPaymentACK(), CWallet::GenerateNewKey(), GetAccountAddress(), CWallet::GetAllReserveKeys(), getnewaddress(), getrawchangeaddress(), HaveKeys(), importprivkey(), importwallet(), IsMine(), CWallet::LoadKeyMetadata(), SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked(), parseTransaction(), CWallet::ReserveKeyFromKeyPool(), SignN(), Solver(), and verifymessage().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned static int CPubKey::GetLen ( unsigned char  chHeader)
inlinestaticprivate

Definition at line 49 of file key.h.

Referenced by Set(), and size().

+ Here is the caller graph for this function:

unsigned int CPubKey::GetSerializeSize ( int  nType,
int  nVersion 
) const
inline

Definition at line 109 of file key.h.

References size().

+ Here is the call graph for this function:

void CPubKey::Invalidate ( )
inlineprivate

Definition at line 58 of file key.h.

Referenced by CPubKey(), Set(), and Unserialize().

+ Here is the caller graph for this function:

bool CPubKey::IsCompressed ( ) const
inline

Definition at line 151 of file key.h.

References size().

Referenced by CCryptoKeyStore::GetKey(), CKey::Load(), CCryptoKeyStore::Unlock(), CoinControlDialog::updateLabels(), CoinControlDialog::updateView(), and VerifyCompact().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CPubKey::IsFullyValid ( ) const

Definition at line 473 of file key.cpp.

References IsValid().

Referenced by _createmultisig_redeemScript(), mastercore::ClassB_send(), and CScriptCompressor::IsToPubKey().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CPubKey::IsValid ( ) const
inline

Definition at line 143 of file key.h.

References size().

Referenced by CheckSig(), Decompress(), Derive(), GetAccountAddress(), CWallet::GetAllReserveKeys(), CReserveKey::GetReservedKey(), IsFullyValid(), CWallet::ReserveKeyFromKeyPool(), Verify(), and VerifyCompact().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const unsigned char& CPubKey::operator[] ( unsigned int  pos) const
inline

Definition at line 93 of file key.h.

bool CPubKey::RecoverCompact ( const uint256 hash,
const std::vector< unsigned char > &  vchSig 
)

Definition at line 448 of file key.cpp.

Referenced by SignVerifyMessageDialog::on_verifyMessageButton_VM_clicked(), and verifymessage().

+ Here is the caller graph for this function:

template<typename Stream >
void CPubKey::Serialize ( Stream &  s,
int  nType,
int  nVersion 
) const
inline

Definition at line 112 of file key.h.

References size(), and WriteCompactSize().

+ Here is the call graph for this function:

template<typename T >
void CPubKey::Set ( const T  pbegin,
const T  pend 
)
inline

Definition at line 70 of file key.h.

References GetLen(), Invalidate(), and memcpy().

Referenced by CPubKey(), CExtPubKey::Decode(), and CScriptCompressor::IsToPubKey().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

unsigned int CPubKey::size ( ) const
inline

Definition at line 90 of file key.h.

References GetLen().

Referenced by CScriptCompressor::Decompress(), CExtPubKey::Encode(), end(), GetHash(), GetID(), GetSerializeSize(), IsCompressed(), IsValid(), CScript::operator<<(), Serialize(), and CWalletDB::WriteKey().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename Stream >
void CPubKey::Unserialize ( Stream &  s,
int  nType,
int  nVersion 
)
inline

Definition at line 117 of file key.h.

References Invalidate(), and ReadCompactSize().

+ Here is the call graph for this function:

bool CPubKey::Verify ( const uint256 hash,
const std::vector< unsigned char > &  vchSig 
) const

Definition at line 437 of file key.cpp.

References IsValid().

Referenced by CheckSig(), and CAlert::CheckSignature().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CPubKey::VerifyCompact ( const uint256 hash,
const std::vector< unsigned char > &  vchSig 
) const

Definition at line 458 of file key.cpp.

References IsCompressed(), and IsValid().

+ Here is the call graph for this function:

Friends And Related Function Documentation

bool operator!= ( const CPubKey a,
const CPubKey b 
)
friend

Definition at line 100 of file key.h.

bool operator< ( const CPubKey a,
const CPubKey b 
)
friend

Definition at line 103 of file key.h.

bool operator== ( const CPubKey a,
const CPubKey b 
)
friend

Definition at line 96 of file key.h.

Member Data Documentation

unsigned char CPubKey::vch[65]
private

Definition at line 46 of file key.h.

Referenced by begin().


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