5 #ifndef BITCOIN_KEYSTORE_H
6 #define BITCOIN_KEYSTORE_H
10 #include <boost/signals2/signal.hpp>
30 virtual void GetKeys(std::set<CKeyID> &setAddress)
const =0;
39 typedef std::map<CKeyID, CKey>
KeyMap;
56 result = (mapKeys.count(address) > 0);
60 void GetKeys(std::set<CKeyID> &setAddress)
const
65 KeyMap::const_iterator mi = mapKeys.begin();
66 while (mi != mapKeys.end())
68 setAddress.insert((*mi).first);
77 KeyMap::const_iterator mi = mapKeys.find(address);
78 if (mi != mapKeys.end())
91 typedef std::map<CKeyID, std::pair<CPubKey, std::vector<unsigned char> > >
CryptedKeyMap;
132 result = vMasterKey.empty();
139 virtual bool AddCryptedKey(
const CPubKey &vchPubKey,
const std::vector<unsigned char> &vchCryptedSecret);
147 return mapCryptedKeys.count(address) > 0;
153 void GetKeys(std::set<CKeyID> &setAddress)
const
161 CryptedKeyMap::const_iterator mi = mapCryptedKeys.begin();
162 while (mi != mapCryptedKeys.end())
164 setAddress.insert((*mi).first);
CCriticalSection cs_KeyStore
virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)=0
bool HaveKey(const CKeyID &address) const
void GetKeys(std::set< CKeyID > &setAddress) const
std::map< CScriptID, CScript > ScriptMap
bool HaveKey(const CKeyID &address) const
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
std::map< CKeyID, std::pair< CPubKey, std::vector< unsigned char > > > CryptedKeyMap
bool EncryptKeys(CKeyingMaterial &vMasterKeyIn)
CKeyingMaterial vMasterKey
virtual bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
Keystore which keeps the private keys encrypted.
bool GetKey(const CKeyID &address, CKey &keyOut) const
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
virtual bool AddCScript(const CScript &redeemScript)=0
virtual bool HaveCScript(const CScriptID &hash) const =0
virtual bool AddCScript(const CScript &redeemScript)
boost::signals2::signal< void(CCryptoKeyStore *wallet)> NotifyStatusChanged
void GetKeys(std::set< CKeyID > &setAddress) const
bool GetKey(const CKeyID &address, CKey &keyOut) const
virtual bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
virtual bool HaveKey(const CKeyID &address) const =0
An encapsulated public key.
bool Unlock(const CKeyingMaterial &vMasterKeyIn)
virtual bool GetKey(const CKeyID &address, CKey &keyOut) const =0
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
virtual bool AddKey(const CKey &key)
CryptedKeyMap mapCryptedKeys
Serialized script, used inside transaction inputs and outputs.
A virtual base class for key stores.
A reference to a CKey: the Hash160 of its serialized public key.
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const
A reference to a CScript: the Hash160 of its serialization (see script.h)
virtual void GetKeys(std::set< CKeyID > &setAddress) const =0
An encapsulated private key.
std::map< CKeyID, CKey > KeyMap
Basic key store, that keeps keys in an address->secret map.
virtual bool HaveCScript(const CScriptID &hash) const
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const =0