MCPcopy Create free account
hub / github.com/LUX-Core/lux / EncryptKeys

Method EncryptKeys

src/crypter.cpp:369–388  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368#endif
369bool CCryptoKeyStore::EncryptKeys(CKeyingMaterial& vMasterKeyIn)
370{
371 LOCK(cs_KeyStore);
372 if (!mapCryptedKeys.empty() || IsCrypted())
373 return false;
374
375 fUseCrypto = true;
376 for (KeyMap::value_type& mKey : mapKeys) {
377 const CKey& key = mKey.second;
378 CPubKey vchPubKey = key.GetPubKey();
379 CKeyingMaterial vchSecret(key.begin(), key.end());
380 std::vector<unsigned char> vchCryptedSecret;
381 if (!EncryptSecret(vMasterKeyIn, vchSecret, vchPubKey.GetHash(), vchCryptedSecret))
382 return false;
383 if (!AddCryptedKey(vchPubKey, vchCryptedSecret))
384 return false;
385 }
386 mapKeys.clear();
387 return true;
388}
389bool CCryptoKeyStore::EncryptHDChain(const CKeyingMaterial& vMasterKeyIn)
390{
391 // should call EncryptKeys first

Callers

nothing calls this directly

Calls 7

EncryptSecretFunction · 0.85
emptyMethod · 0.45
GetPubKeyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
GetHashMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected