[#wallet-CCrypter-SetKey] = xref:wallet.adoc[wallet]::xref:wallet/CCrypter.adoc[CCrypter]::SetKey :relfileprefix: ../../ :mrdocs: Sets the encryption key and IV directly. == Synopsis Declared in `<wallet/crypter.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- [[nodiscard]] bool SetKey( xref:wallet/CKeyingMaterial.adoc[CKeyingMaterial] const& new_key, std::span<unsigned char const> new_iv); ---- == Return Value true if the key and IV were the expected sizes and were set. [NOTE] ==== The return value https://en.cppreference.com/cpp/language/attributes/nodiscard[should not be discarded^]. ==== == Parameters [cols="1,4"] |=== | Name| Description | *new_key* | The key material to use. | *new_iv* | The initialization vector to use. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#