Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/crypter.h
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Keystore which keeps the private keys encrypted. | * Keystore which keeps the private keys encrypted. | ||||
* It derives from the basic key store, which is used if no encryption is | * It derives from the basic key store, which is used if no encryption is | ||||
* active. | * active. | ||||
*/ | */ | ||||
class CCryptoKeyStore : public CBasicKeyStore { | class CCryptoKeyStore : public CBasicKeyStore { | ||||
private: | private: | ||||
CryptedKeyMap mapCryptedKeys; | |||||
CKeyingMaterial vMasterKey; | CKeyingMaterial vMasterKey; | ||||
//! if fUseCrypto is true, mapKeys must be empty | //! if fUseCrypto is true, mapKeys must be empty | ||||
//! if fUseCrypto is false, vMasterKey must be empty | //! if fUseCrypto is false, vMasterKey must be empty | ||||
bool fUseCrypto; | bool fUseCrypto; | ||||
//! keeps track of whether Unlock has run a thorough check before | //! keeps track of whether Unlock has run a thorough check before | ||||
bool fDecryptionThoroughlyChecked; | bool fDecryptionThoroughlyChecked; | ||||
protected: | protected: | ||||
bool SetCrypted(); | bool SetCrypted(); | ||||
//! will encrypt previously unencrypted keys | //! will encrypt previously unencrypted keys | ||||
bool EncryptKeys(CKeyingMaterial &vMasterKeyIn); | bool EncryptKeys(CKeyingMaterial &vMasterKeyIn); | ||||
bool Unlock(const CKeyingMaterial &vMasterKeyIn); | bool Unlock(const CKeyingMaterial &vMasterKeyIn); | ||||
CryptedKeyMap mapCryptedKeys; | |||||
public: | public: | ||||
CCryptoKeyStore() | CCryptoKeyStore() | ||||
: fUseCrypto(false), fDecryptionThoroughlyChecked(false) {} | : fUseCrypto(false), fDecryptionThoroughlyChecked(false) {} | ||||
bool IsCrypted() const { return fUseCrypto; } | bool IsCrypted() const { return fUseCrypto; } | ||||
bool IsLocked() const { | bool IsLocked() const { | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |