Trait GetKey
pub trait GetKey {
type Error: Debug;
// Required method
fn get_key<C>(
&self,
key_request: KeyRequest,
secp: &Secp256k1<C>,
) -> Result<Option<PrivateKey>, Self::Error>
where C: Signing;
}
Expand description
Trait to get a private key from a key request, key is then used to sign an input.
Required Associated Types§
Required Methods§
fn get_key<C>(
&self,
key_request: KeyRequest,
secp: &Secp256k1<C>,
) -> Result<Option<PrivateKey>, Self::Error>where
C: Signing,
fn get_key<C>(
&self,
key_request: KeyRequest,
secp: &Secp256k1<C>,
) -> Result<Option<PrivateKey>, Self::Error>where
C: Signing,
Attempts to get the private key for key_request
.
§Returns
Some(key)
if the key is found.None
if the key was not found but no error was encountered.Err
if an error was encountered while looking for the key.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.