Raven Core  3.0.0
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
 
bool Lock ()
 
virtual bool AddCryptedKey (const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
 
bool AddKeyPubKey (const CKey &key, const CPubKey &pubkey) override
 Add a key to the store. More...
 
bool HaveKey (const CKeyID &address) const override
 Check whether a key corresponding to a given address is present in the store. More...
 
bool GetKey (const CKeyID &address, CKey &keyOut) const override
 
bool GetPubKey (const CKeyID &address, CPubKey &vchPubKeyOut) const override
 
std::set< CKeyIDGetKeys () const override
 
- Public Member Functions inherited from CBasicKeyStore
bool AddCScript (const CScript &redeemScript) override
 Support for BIP 0013 : see https://github.com/raven/bips/blob/master/bip-0013.mediawiki. More...
 
bool HaveCScript (const CScriptID &hash) const override
 
bool GetCScript (const CScriptID &hash, CScript &redeemScriptOut) const override
 
bool AddWatchOnly (const CScript &dest) override
 Support for Watch-only addresses. More...
 
bool RemoveWatchOnly (const CScript &dest) override
 
bool HaveWatchOnly (const CScript &dest) const override
 
bool HaveWatchOnly () const override
 
- 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 Unlock (const CKeyingMaterial &vMasterKeyIn)
 

Protected Attributes

CryptedKeyMap mapCryptedKeys
 
- Protected Attributes inherited from CBasicKeyStore
KeyMap mapKeys
 
WatchKeyMap mapWatchKeys
 
ScriptMap mapScripts
 
WatchOnlySet setWatchOnly
 
- Protected Attributes inherited from CKeyStore
CCriticalSection cs_KeyStore
 

Private Attributes

CKeyingMaterial vMasterKey
 
std::atomic< bool > fUseCrypto
 if fUseCrypto is true, mapKeys must be empty if fUseCrypto is false, vMasterKey must be empty More...
 
bool fDecryptionThoroughlyChecked
 keeps track of whether Unlock has run a thorough check before 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 116 of file crypter.h.

Constructor & Destructor Documentation

◆ CCryptoKeyStore()

CCryptoKeyStore::CCryptoKeyStore ( )
inline

Definition at line 139 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 230 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 
)
overridevirtual

Add a key to the store.

Reimplemented from CBasicKeyStore.

Reimplemented in CWallet.

Definition at line 208 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 278 of file crypter.cpp.

Here is the call graph for this function:

◆ GetKey()

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

Reimplemented from CBasicKeyStore.

Definition at line 242 of file crypter.cpp.

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

◆ GetKeys()

std::set<CKeyID> CCryptoKeyStore::GetKeys ( ) const
inlineoverridevirtual

Reimplemented from CBasicKeyStore.

Definition at line 177 of file crypter.h.

Here is the call graph for this function:

◆ GetPubKey()

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

Reimplemented from CBasicKeyStore.

Definition at line 260 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
inlineoverridevirtual

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

Reimplemented from CBasicKeyStore.

Definition at line 164 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 143 of file crypter.h.

Here is the caller graph for this function:

◆ IsLocked()

bool CCryptoKeyStore::IsLocked ( ) const
inline

Definition at line 148 of file crypter.h.

Here is the caller graph for this function:

◆ Lock()

bool CCryptoKeyStore::Lock ( )

Definition at line 156 of file crypter.cpp.

Here is the caller graph for this function:

◆ SetCrypted()

bool CCryptoKeyStore::SetCrypted ( )
protected

Definition at line 145 of file crypter.cpp.

◆ Unlock()

bool CCryptoKeyStore::Unlock ( const CKeyingMaterial vMasterKeyIn)
protected

Definition at line 170 of file crypter.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ fDecryptionThoroughlyChecked

bool CCryptoKeyStore::fDecryptionThoroughlyChecked
private

keeps track of whether Unlock has run a thorough check before

Definition at line 127 of file crypter.h.

◆ fUseCrypto

std::atomic<bool> CCryptoKeyStore::fUseCrypto
private

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

Definition at line 124 of file crypter.h.

◆ mapCryptedKeys

CryptedKeyMap CCryptoKeyStore::mapCryptedKeys
protected

Definition at line 136 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 194 of file crypter.h.

◆ vMasterKey

CKeyingMaterial CCryptoKeyStore::vMasterKey
private

Definition at line 120 of file crypter.h.


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