PRCYCoin  2.0.0.7rc1
P2P Digital Currency
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
CCryptoKeyStore Class Reference

Keystore which keeps the private keys encrypted. More...

#include <crypter.h>

Inheritance diagram for CCryptoKeyStore:
[legend]
Collaboration diagram for CCryptoKeyStore:
[legend]

Public Member Functions

 CCryptoKeyStore ()
 
bool IsCrypted () const
 
bool IsLocked () const
 
virtual bool AddCryptedKey (const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
 
bool AddKeyPubKey (const CKey &key, const CPubKey &pubkey)
 Add a key to the store. More...
 
bool HaveKey (const CKeyID &address) const
 Check whether a key corresponding to a given address is present in the store. More...
 
bool GetKey (const CKeyID &address, CKey &keyOut) const
 
bool GetPubKey (const CKeyID &address, CPubKey &vchPubKeyOut) const
 
void GetKeys (std::set< CKeyID > &setAddress) const
 
- Public Member Functions inherited from CBasicKeyStore
bool AddKeyPubKey (const CKey &key, const CPubKey &pubkey)
 Add a key to the store. More...
 
bool HaveKey (const CKeyID &address) const
 Check whether a key corresponding to a given address is present in the store. More...
 
void GetKeys (std::set< CKeyID > &setAddress) const
 
bool GetKey (const CKeyID &address, CKey &keyOut) const
 
virtual bool AddCScript (const CScript &redeemScript)
 Support for BIP 0013 : see https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki. More...
 
virtual bool HaveCScript (const CScriptID &hash) const
 
virtual bool GetCScript (const CScriptID &hash, CScript &redeemScriptOut) const
 
virtual bool AddWatchOnly (const CScript &dest)
 Support for Watch-only addresses. More...
 
virtual bool RemoveWatchOnly (const CScript &dest)
 
virtual bool HaveWatchOnly (const CScript &dest) const
 
virtual bool HaveWatchOnly () const
 
- Public Member Functions inherited from CKeyStore
virtual ~CKeyStore ()
 
virtual bool AddKey (const CKey &key)
 

Public Attributes

boost::signals2::signal< void(CCryptoKeyStore *wallet)> NotifyStatusChanged
 Wallet status (encrypted, locked) changed. More...
 

Protected Member Functions

bool SetCrypted ()
 
bool EncryptKeys (CKeyingMaterial &vMasterKeyIn)
 will encrypt previously unencrypted keys More...
 
bool EncryptHDChain (const CKeyingMaterial &vMasterKeyIn)
 
bool DecryptHDChain (CHDChain &hdChainRet) const
 
bool SetHDChain (const CHDChain &chain)
 
bool SetCryptedHDChain (const CHDChain &chain)
 
bool GetHDChain (CHDChain &hdChainRet) const
 

Protected Attributes

CKeyingMaterial vMasterKey
 
CryptedKeyMap mapCryptedKeys
 
CHDChain cryptedHDChain
 
- Protected Attributes inherited from CBasicKeyStore
KeyMap mapKeys
 
ScriptMap mapScripts
 
WatchOnlySet setWatchOnly
 
MultiSigScriptSet setMultiSig
 
CHDChain hdChain
 
- Protected Attributes inherited from CKeyStore
RecursiveMutex cs_KeyStore
 

Private Attributes

bool fUseCrypto
 if fUseCrypto is true, mapKeys must be empty if fUseCrypto is false, vMasterKey must be empty More...
 

Detailed Description

Keystore which keeps the private keys encrypted.

It derives from the basic key store, which is used if no encryption is active.

Definition at line 127 of file crypter.h.

Constructor & Destructor Documentation

◆ CCryptoKeyStore()

CCryptoKeyStore::CCryptoKeyStore ( )
inline

Definition at line 152 of file crypter.h.

Member Function Documentation

◆ AddCryptedKey()

bool CCryptoKeyStore::AddCryptedKey ( const CPubKey vchPubKey,
const std::vector< unsigned char > &  vchCryptedSecret 
)
virtual

Reimplemented in CWallet.

Definition at line 160 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddKeyPubKey()

bool CCryptoKeyStore::AddKeyPubKey ( const CKey key,
const CPubKey pubkey 
)
virtual

Add a key to the store.

Implements CKeyStore.

Reimplemented in CWallet.

Definition at line 138 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DecryptHDChain()

bool CCryptoKeyStore::DecryptHDChain ( CHDChain hdChainRet) const
protected

Definition at line 287 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EncryptHDChain()

bool CCryptoKeyStore::EncryptHDChain ( const CKeyingMaterial vMasterKeyIn)
protected

Definition at line 234 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EncryptKeys()

bool CCryptoKeyStore::EncryptKeys ( CKeyingMaterial vMasterKeyIn)
protected

will encrypt previously unencrypted keys

Definition at line 211 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHDChain()

bool CCryptoKeyStore::GetHDChain ( CHDChain hdChainRet) const
protected

Definition at line 358 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetKey()

bool CCryptoKeyStore::GetKey ( const CKeyID address,
CKey keyOut 
) const
virtual

Implements CKeyStore.

Reimplemented in CWallet.

Definition at line 172 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetKeys()

void CCryptoKeyStore::GetKeys ( std::set< CKeyID > &  setAddress) const
inlinevirtual

Implements CKeyStore.

Definition at line 185 of file crypter.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetPubKey()

bool CCryptoKeyStore::GetPubKey ( const CKeyID address,
CPubKey vchPubKeyOut 
) const
virtual

Reimplemented from CKeyStore.

Reimplemented in CWallet.

Definition at line 195 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HaveKey()

bool CCryptoKeyStore::HaveKey ( const CKeyID address) const
inlinevirtual

Check whether a key corresponding to a given address is present in the store.

Implements CKeyStore.

Reimplemented in CWallet.

Definition at line 173 of file crypter.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsCrypted()

bool CCryptoKeyStore::IsCrypted ( ) const
inline

Definition at line 154 of file crypter.h.

Here is the caller graph for this function:

◆ IsLocked()

bool CCryptoKeyStore::IsLocked ( ) const
inline

Definition at line 159 of file crypter.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCrypted()

bool CCryptoKeyStore::SetCrypted ( )
protected

Definition at line 127 of file crypter.cpp.

Here is the caller graph for this function:

◆ SetCryptedHDChain()

bool CCryptoKeyStore::SetCryptedHDChain ( const CHDChain chain)
protected

Definition at line 346 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetHDChain()

bool CCryptoKeyStore::SetHDChain ( const CHDChain chain)
protected

Definition at line 334 of file crypter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cryptedHDChain

CHDChain CCryptoKeyStore::cryptedHDChain
protected

Definition at line 149 of file crypter.h.

◆ fUseCrypto

bool CCryptoKeyStore::fUseCrypto
private

if fUseCrypto is true, mapKeys must be empty if fUseCrypto is false, vMasterKey must be empty

Definition at line 132 of file crypter.h.

◆ mapCryptedKeys

CryptedKeyMap CCryptoKeyStore::mapCryptedKeys
protected

Definition at line 148 of file crypter.h.

◆ NotifyStatusChanged

boost::signals2::signal<void(CCryptoKeyStore* wallet)> CCryptoKeyStore::NotifyStatusChanged

Wallet status (encrypted, locked) changed.

Note: Called without locks held.

Definition at line 203 of file crypter.h.

◆ vMasterKey

CKeyingMaterial CCryptoKeyStore::vMasterKey
protected
Todo:
: In the future, move this variable to the wallet class directly following upstream's structure.

Definition at line 136 of file crypter.h.


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