| 391 | } |
| 392 | |
| 393 | bool LegacyDataSPKM::GetKey(const CKeyID &address, CKey& keyOut) const |
| 394 | { |
| 395 | LOCK(cs_KeyStore); |
| 396 | if (!m_storage.HasEncryptionKeys()) { |
| 397 | return FillableSigningProvider::GetKey(address, keyOut); |
| 398 | } |
| 399 | |
| 400 | CryptedKeyMap::const_iterator mi = mapCryptedKeys.find(address); |
| 401 | if (mi != mapCryptedKeys.end()) |
| 402 | { |
| 403 | const CPubKey &vchPubKey = (*mi).second.first; |
| 404 | const std::vector<unsigned char> &vchCryptedSecret = (*mi).second.second; |
| 405 | return m_storage.WithEncryptionKey([&](const CKeyingMaterial& encryption_key) { |
| 406 | return DecryptKey(encryption_key, vchCryptedSecret, vchPubKey, keyOut); |
| 407 | }); |
| 408 | } |
| 409 | return false; |
| 410 | } |
| 411 | |
| 412 | bool LegacyDataSPKM::GetKeyOrigin(const CKeyID& keyID, KeyOriginInfo& info) const |
| 413 | { |
no test coverage detected