![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
An encapsulated private key. More...
#include <key.h>
Public Member Functions | |
CKey () | |
CKey (const CKey &secret) | |
~CKey () | |
template<typename T > | |
void | Set (const T pbegin, const T pend, bool fCompressedIn) |
unsigned int | size () const |
const unsigned char * | begin () const |
const unsigned char * | end () const |
bool | IsValid () const |
bool | IsCompressed () const |
bool | SetPrivKey (const CPrivKey &vchPrivKey, bool fCompressed) |
void | MakeNewKey (bool fCompressed) |
CPrivKey | GetPrivKey () const |
CPubKey | GetPubKey () const |
bool | Sign (const uint256 &hash, std::vector< unsigned char > &vchSig) const |
bool | SignCompact (const uint256 &hash, std::vector< unsigned char > &vchSig) const |
bool | Derive (CKey &keyChild, unsigned char ccChild[32], unsigned int nChild, const unsigned char cc[32]) const |
bool | Load (CPrivKey &privkey, CPubKey &vchPubKey, bool fSkipCheck) |
Static Private Member Functions | |
static bool | Check (const unsigned char *vch) |
Private Attributes | |
bool | fValid |
bool | fCompressed |
unsigned char | vch [32] |
Friends | |
bool | operator== (const CKey &a, const CKey &b) |
|
inline |
Definition at line 196 of file key.h.
References LockObject().
|
inline |
Definition at line 201 of file key.h.
References LockObject(), memcpy(), and vch.
|
inline |
Definition at line 207 of file key.h.
References UnlockObject().
|
inline |
Definition at line 234 of file key.h.
References vch.
Referenced by CCryptoKeyStore::AddKeyPubKey(), Derive(), CExtKey::Encode(), CCryptoKeyStore::EncryptKeys(), and CBitcoinSecret::SetKey().
|
staticprivate |
Definition at line 337 of file key.cpp.
Referenced by MakeNewKey(), and Set().
bool CKey::Derive | ( | CKey & | keyChild, |
unsigned char | ccChild[32], | ||
unsigned int | nChild, | ||
const unsigned char | cc[32] | ||
) | const |
Definition at line 506 of file key.cpp.
References CPubKey::begin(), begin(), BIP32Hash(), CPubKey::end(), end(), fCompressed, fValid, GetPubKey(), IsCompressed(), IsValid(), LockObject(), memcpy(), and UnlockObject().
Referenced by CExtKey::Derive().
|
inline |
Definition at line 235 of file key.h.
References size().
Referenced by CCryptoKeyStore::AddKeyPubKey(), Derive(), and CCryptoKeyStore::EncryptKeys().
CPrivKey CKey::GetPrivKey | ( | ) | const |
Definition at line 379 of file key.cpp.
Referenced by CWallet::AddKeyPubKey().
CPubKey CKey::GetPubKey | ( | ) | const |
Definition at line 388 of file key.cpp.
Referenced by CKeyStore::AddKey(), Derive(), CExtKey::Derive(), CCryptoKeyStore::EncryptKeys(), CWallet::GenerateNewKey(), CKeyStore::GetPubKey(), importprivkey(), importwallet(), Load(), CExtKey::Neuter(), and CCryptoKeyStore::Unlock().
|
inline |
Definition at line 241 of file key.h.
References fCompressed.
Referenced by Derive(), and CBitcoinSecret::SetKey().
|
inline |
Definition at line 238 of file key.h.
References fValid.
Referenced by Derive(), importprivkey(), and CBitcoinSecret::SetKey().
Definition at line 419 of file key.cpp.
References fValid, GetPubKey(), CPubKey::IsCompressed(), and vch.
Referenced by ReadKeyValue().
void CKey::MakeNewKey | ( | bool | fCompressed | ) |
|
inline |
Definition at line 218 of file key.h.
References Check(), and memcpy().
Referenced by CExtKey::Decode(), CBitcoinSecret::GetKey(), CCryptoKeyStore::GetKey(), CExtKey::SetMaster(), and CCryptoKeyStore::Unlock().
bool CKey::SetPrivKey | ( | const CPrivKey & | vchPrivKey, |
bool | fCompressed | ||
) |
bool CKey::Sign | ( | const uint256 & | hash, |
std::vector< unsigned char > & | vchSig | ||
) | const |
bool CKey::SignCompact | ( | const uint256 & | hash, |
std::vector< unsigned char > & | vchSig | ||
) | const |
Definition at line 405 of file key.cpp.
Referenced by SignVerifyMessageDialog::on_signMessageButton_SM_clicked(), and signmessage().
|
inline |
Definition at line 233 of file key.h.
Referenced by CExtKey::Encode(), end(), and CBitcoinSecret::SetKey().
|
private |
Definition at line 186 of file key.h.
Referenced by Derive(), and IsCompressed().
|
private |
Definition at line 183 of file key.h.
Referenced by Derive(), GetPrivKey(), GetPubKey(), IsValid(), Load(), MakeNewKey(), SetPrivKey(), Sign(), and SignCompact().
|
private |
Definition at line 189 of file key.h.
Referenced by begin(), CKey(), GetPrivKey(), GetPubKey(), Load(), MakeNewKey(), SetPrivKey(), Sign(), and SignCompact().