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

Method AddKeyPubKey

src/crypter.cpp:280–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280bool CCryptoKeyStore::AddKeyPubKey(const CKey& key, const CPubKey& pubkey)
281{
282 LOCK(cs_KeyStore);
283 if (!IsCrypted())
284 return CBasicKeyStore::AddKeyPubKey(key, pubkey);
285
286 if (IsLocked())
287 return false;
288
289 std::vector<unsigned char> vchCryptedSecret;
290 CKeyingMaterial vchSecret(key.begin(), key.end());
291 if (!EncryptSecret(vMasterKey, vchSecret, pubkey.GetHash(), vchCryptedSecret))
292 return false;
293
294 if (!AddCryptedKey(pubkey, vchCryptedSecret))
295 return false;
296 return true;
297}
298
299
300bool CCryptoKeyStore::AddCryptedKey(const CPubKey& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret)

Callers

nothing calls this directly

Calls 4

EncryptSecretFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected