Decrypts an encrypted private key and validates it against its public key.
Declared in <wallet/crypter.h>
[[nodiscard]]
bool
DecryptKey(
CKeyingMaterial const& master_key,
std::span<unsigned char const> crypted_secret,
CPubKey const& pub_key,
CKey& key);
true if the key was decrypted and matches the public key.
The return value should not be discarded.
| Name | Description |
|---|---|
| master_key | The master key used to decrypt the private key. |
| crypted_secret | The encrypted private key. |
| pub_key | The public key the decrypted key must match. |
| key | Receives the recovered private key. |