63 typedef std::vector<unsigned char, secure_allocator<unsigned char> >
CKeyingMaterial;
87 std::vector<unsigned char, secure_allocator<unsigned char>>
vchKey;
88 std::vector<unsigned char, secure_allocator<unsigned char>>
vchIV;
91 int BytesToKeySHA512AES(
const std::vector<unsigned char>& chSalt,
const SecureString& strKeyData,
int count,
unsigned char *key,
unsigned char *iv)
const;
94 bool SetKeyFromPassphrase(
const SecureString& strKeyData,
const std::vector<unsigned char>& chSalt,
const unsigned int nRounds,
const unsigned int nDerivationMethod);
157 virtual bool AddCryptedKey(
const CPubKey& vchPubKey,
const std::vector<unsigned char>& vchCryptedSecret);
163 std::set<CKeyID>
GetKeys()
const override;
167 const std::vector<unsigned char>& vchCryptedSecret);
Double ended buffer combining vector and stream-like interfaces.
CKeyingMaterial vector_type
vector_type::const_iterator const_iterator
Basic key store, that keeps keys in an address->secret map.
Encryption/decryption context with key information.
bool Encrypt(const CKeyingMaterial &vchPlaintext, std::vector< unsigned char > &vchCiphertext) const
bool SetKey(const CKeyingMaterial &chNewKey, const std::vector< unsigned char > &chNewIV)
friend class wallet_crypto::TestCrypter
bool SetKeyFromPassphrase(const SecureString &strKeyData, const std::vector< unsigned char > &chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod)
bool Decrypt(const std::vector< unsigned char > &vchCiphertext, CKeyingMaterial &vchPlaintext) const
int BytesToKeySHA512AES(const std::vector< unsigned char > &chSalt, const SecureString &strKeyData, int count, unsigned char *key, unsigned char *iv) const
std::vector< unsigned char, secure_allocator< unsigned char > > vchIV
std::vector< unsigned char, secure_allocator< unsigned char > > vchKey
Keystore which keeps the private keys encrypted.
bool GetKey(const CKeyID &address, CKey &keyOut) const override
std::atomic< bool > fUseCrypto
if fUseCrypto is true, mapKeys and mapSaplingSpendingKeys must be empty if fUseCrypto is false,...
static bool DecryptKey(const CKeyingMaterial &vMasterKey, const std::vector< unsigned char > &vchCryptedSecret, const CPubKey &vchPubKey, CKey &key)
CryptedSaplingSpendingKeyMap mapCryptedSaplingSpendingKeys
bool HaveSaplingSpendingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk) const override
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey) override
Add a key to the store.
bool HaveKey(const CKeyID &address) const override
Check whether a key corresponding to a given address is present in the store.
virtual bool AddCryptedSaplingSpendingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk, const std::vector< unsigned char > &vchCryptedSecret)
Sapling.
bool UnlockSaplingKeys(const CKeyingMaterial &vMasterKeyIn, bool fDecryptionThoroughlyChecked)
bool EncryptKeys(CKeyingMaterial &vMasterKeyIn)
will encrypt previously unencrypted keys
virtual bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
bool GetSaplingSpendingKey(const libzcash::SaplingExtendedFullViewingKey &extfvk, libzcash::SaplingExtendedSpendingKey &skOut) const override
CKeyingMaterial vMasterKey
CryptedKeyMap mapCryptedKeys
std::set< CKeyID > GetKeys() const override
boost::signals2::signal< void(CCryptoKeyStore *wallet)> NotifyStatusChanged
Wallet status (encrypted, locked) changed.
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const override
An encapsulated private key.
A reference to a CKey: the Hash160 of its serialized public key.
Private key encryption is done based on a CMasterKey, which holds a salt and random encryption key.
std::vector< unsigned char > vchSalt
SERIALIZE_METHODS(CMasterKey, obj)
unsigned int nDerivationMethod
0 = EVP_sha512() 1 = scrypt()
std::vector< unsigned char > vchCryptedKey
std::vector< unsigned char > vchOtherDerivationParameters
Use this for more parameters to key derivation, such as the various parameters to scrypt.
unsigned int nDeriveIterations
An encapsulated public key.
CSecureDataStream(const_iterator pbegin, const_iterator pend, int nTypeIn, int nVersionIn)
CSecureDataStream(int nTypeIn, int nVersionIn)
CSecureDataStream(const vector_type &vchIn, int nTypeIn, int nVersionIn)
void memory_cleanse(void *ptr, size_t len)
bool EncryptSecret(const CKeyingMaterial &vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256 &nIV, std::vector< unsigned char > &vchCiphertext)
const unsigned int WALLET_CRYPTO_IV_SIZE
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
const unsigned int WALLET_CRYPTO_SALT_SIZE
const unsigned int WALLET_CRYPTO_KEY_SIZE
bool DecryptSecret(const CKeyingMaterial &vMasterKey, const std::vector< unsigned char > &vchCiphertext, const uint256 &nIV, CKeyingMaterial &vchPlaintext)
std::map< libzcash::SaplingExtendedFullViewingKey, std::vector< unsigned char > > CryptedSaplingSpendingKeyMap
Sapling.
std::map< CKeyID, std::pair< CPubKey, std::vector< unsigned char > > > CryptedKeyMap
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString