 |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
Go to the documentation of this file.
5 #ifndef BITCOIN_CRYPTER_H
6 #define BITCOIN_CRYPTER_H
49 template <
typename Stream,
typename Operation>
50 inline void SerializationOp(Stream& s, Operation ser_action,
int nType,
int nVersion)
69 typedef std::vector<unsigned char, secure_allocator<unsigned char> >
CKeyingMaterial;
88 bool SetKeyFromPassphrase(
const SecureString& strKeyData,
const std::vector<unsigned char>& chSalt,
const unsigned int nRounds,
const unsigned int nDerivationMethod);
171 virtual bool AddCryptedKey(
const CPubKey& vchPubKey,
const std::vector<unsigned char>& vchCryptedSecret);
185 void GetKeys(std::set<CKeyID>& setAddress)
const
194 setAddress.insert((*mi).first);
206 #endif // BITCOIN_CRYPTER_H
void GetKeys(std::set< CKeyID > &setAddress) const
std::vector< unsigned char > vchSalt
const unsigned int WALLET_CRYPTO_KEY_SIZE
bool EncryptHDChain(const CKeyingMaterial &vMasterKeyIn)
void UnlockRange(void *p, size_t size)
std::vector< unsigned char > vchOtherDerivationParameters
Use this for more parameters to key derivation, such as the various parameters to scrypt.
friend class wallet_crypto::TestCrypter
Keystore which keeps the private keys encrypted.
bool Encrypt(const CKeyingMaterial &vchPlaintext, std::vector< unsigned char > &vchCiphertext) const
bool SetHDChain(const CHDChain &chain)
void GetKeys(std::set< CKeyID > &setAddress) const
bool GetKey(const CKeyID &address, CKey &keyOut) const
std::vector< unsigned char, secure_allocator< unsigned char > > CKeyingMaterial
bool DecryptSecret(const CKeyingMaterial &vMasterKey, const std::vector< unsigned char > &vchCiphertext, const uint256 &nIV, CKeyingMaterial &vchPlaintext)
std::vector< unsigned char > vchCryptedKey
bool HaveKey(const CKeyID &address) const
Check whether a key corresponding to a given address is present in the store.
bool Decrypt(const std::vector< unsigned char > &vchCiphertext, CKeyingMaterial &vchPlaintext) const
Private key encryption is done based on a CMasterKey, which holds a salt and random encryption key.
A reference to a CKey: the Hash160 of its serialized public key.
void memory_cleanse(void *ptr, size_t len)
RecursiveMutex cs_KeyStore
bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
Add a key to the store.
const unsigned int WALLET_CRYPTO_IV_SIZE
unsigned char chIV[WALLET_CRYPTO_IV_SIZE]
boost::signals2::signal< void(CCryptoKeyStore *wallet)> NotifyStatusChanged
Wallet status (encrypted, locked) changed.
int BytesToKeySHA512AES(const std::vector< unsigned char > &chSalt, const SecureString &strKeyData, int count, unsigned char *key, unsigned char *iv) const
bool SetCryptedHDChain(const CHDChain &chain)
bool fUseCrypto
if fUseCrypto is true, mapKeys must be empty if fUseCrypto is false, vMasterKey must be empty
std::basic_string< char, std::char_traits< char >, secure_allocator< char > > SecureString
unsigned char chKey[WALLET_CRYPTO_KEY_SIZE]
256-bit unsigned big integer.
std::map< CKeyID, std::pair< CPubKey, std::vector< unsigned char > > > CryptedKeyMap
void SerializationOp(Stream &s, Operation ser_action, int nType, int nVersion)
virtual bool AddCryptedKey(const CPubKey &vchPubKey, const std::vector< unsigned char > &vchCryptedSecret)
An encapsulated public key.
bool SetKey(const CKeyingMaterial &chNewKey, const std::vector< unsigned char > &chNewIV)
bool EncryptSecret(const CKeyingMaterial &vMasterKey, const CKeyingMaterial &vchPlaintext, const uint256 &nIV, std::vector< unsigned char > &vchCiphertext)
An encapsulated private key.
Encryption/decryption context with key information.
bool DecryptHDChain(CHDChain &hdChainRet) const
bool GetHDChain(CHDChain &hdChainRet) const
CryptedKeyMap mapCryptedKeys
bool SetKeyFromPassphrase(const SecureString &strKeyData, const std::vector< unsigned char > &chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod)
unsigned int nDerivationMethod
0 = EVP_sha512() 1 = scrypt()
static LockedPageManager & Instance()
bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const
Basic key store, that keeps keys in an address->secret map.
const unsigned int WALLET_CRYPTO_SALT_SIZE
CKeyingMaterial vMasterKey
unsigned int nDeriveIterations
bool EncryptKeys(CKeyingMaterial &vMasterKeyIn)
will encrypt previously unencrypted keys
bool HaveKey(const CKeyID &address) const
Check whether a key corresponding to a given address is present in the store.
void LockRange(void *p, size_t size)