Find the private key for the given key id from the wallet's descriptors, if available Returns nullopt when no descriptor has the key or if the wallet is locked.
Declared in <wallet/wallet.h>
<wallet/wallet.h>
std::optional<CKey> GetKey(CKeyID const& keyid) const;
The private key, or nullopt if unavailable.