5 #ifndef BITCOIN_WALLET_CRYPTER_H 6 #define BITCOIN_WALLET_CRYPTER_H 48 template <
typename Stream,
typename Operation>
49 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion) {
67 typedef std::vector<unsigned char, secure_allocator<unsigned char> >
CKeyingMaterial;
78 bool SetKeyFromPassphrase(
const SecureString &strKeyData,
const std::vector<unsigned char>& chSalt,
const unsigned int nRounds,
const unsigned int nDerivationMethod);
187 bool Lock(
bool fAllowMixing =
false);
189 virtual bool AddCryptedKey(
const CPubKey &vchPubKey,
const std::vector<unsigned char> &vchCryptedSecret);
203 void GetKeys(std::set<CKeyID> &setAddress)
const 214 setAddress.insert((*mi).first);
228 #endif // BITCOIN_WALLET_CRYPTER_H std::vector< unsigned char > vchSalt
bool HaveKey(const CKeyID &address) const
Check whether a key corresponding to a given address is present in the store.
std::vector< unsigned char > vchOtherDerivationParameters
const unsigned int WALLET_CRYPTO_KEY_SIZE
bool DecryptHDChain(CHDChain &hdChainRet) const
bool Encrypt(const CKeyingMaterial &vchPlaintext, std::vector< unsigned char > &vchCiphertext)
bool fOnlyMixingAllowed
if fOnlyMixingAllowed is true, only mixing should be allowed in unlocked wallet
unsigned char chKey[WALLET_CRYPTO_KEY_SIZE]
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
Add a key to the store.
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
bool HaveKey(const CKeyID &address) const
Check whether a key corresponding to a given address is present in the store.
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
CryptedKeyMap mapCryptedKeys
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
bool SetKeyFromPassphrase(const SecureString &strKeyData, const std::vector< unsigned char > &chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod)
std::map< CKeyID, std::pair< CPubKey, std::vector< unsigned char > > > CryptedKeyMap
bool DecryptAES256(const SecureString &sKey, const std::string &sCiphertext, const std::string &sIV, SecureString &sPlaintext)
bool GetKey(const CKeyID &address, CKey &keyOut) const
bool SetHDChain(const CHDChain &chain)
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
bool GetHDChain(CHDChain &hdChainRet) const
unsigned char chIV[WALLET_CRYPTO_KEY_SIZE]
void memory_cleanse(void *ptr, size_t len)
CCriticalSection cs_KeyStore
void LockRange(void *p, size_t size)
boost::signals2::signal< void(CCryptoKeyStore *wallet)> NotifyStatusChanged
unsigned int nDeriveIterations
bool IsLocked(bool fForMixing=false) const
void UnlockRange(void *p, size_t size)
bool SetKey(const CKeyingMaterial &chNewKey, const std::vector< unsigned char > &chNewIV)
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
std::vector< unsigned char > vchCryptedKey
bool Decrypt(const std::vector< unsigned char > &vchCiphertext, CKeyingMaterial &vchPlaintext)
void GetKeys(std::set< CKeyID > &setAddress) const
void GetKeys(std::set< CKeyID > &setAddress) const
const unsigned int WALLET_CRYPTO_SALT_SIZE
unsigned int nDerivationMethod
bool Unlock(const CKeyingMaterial &vMasterKeyIn, bool fForMixingOnly=false)
bool Lock(bool fAllowMixing=false)
bool EncryptHDChain(const CKeyingMaterial &vMasterKeyIn)
virtual bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
CKeyingMaterial vMasterKey
bool fDecryptionThoroughlyChecked
keeps track of whether Unlock has run a thorough check before
static LockedPageManager & Instance()
bool SetCryptedHDChain(const CHDChain &chain)
bool EncryptAES256(const SecureString &sKey, const SecureString &sPlaintext, const std::string &sIV, std::string &sCiphertext)
bool EncryptKeys(CKeyingMaterial &vMasterKeyIn)
will encrypt previously unencrypted keys