[#wallet-DecryptKey] = xref:wallet.adoc[wallet]::DecryptKey :relfileprefix: ../ :mrdocs: Decrypts an encrypted private key and validates it against its public key. == Synopsis Declared in `<wallet/crypter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] bool DecryptKey( xref:wallet/CKeyingMaterial.adoc[CKeyingMaterial] const& master_key, std::span<unsigned char const> crypted_secret, xref:CPubKey.adoc[CPubKey] const& pub_key, xref:CKey.adoc[CKey]& key); ---- == Return Value true if the key was decrypted and matches the public key. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | 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. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#