| 278 | } |
| 279 | |
| 280 | bool 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 | |
| 300 | bool CCryptoKeyStore::AddCryptedKey(const CPubKey& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret) |
nothing calls this directly
no test coverage detected