pub trait GetKey {
type Error: Debug;
// Required method
fn get_key<C: Signing>(
&self,
key_request: KeyRequest,
secp: &Secp256k1<C>
) -> Result<Option<PrivateKey>, Self::Error>;
}
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§
sourcefn get_key<C: Signing>(
&self,
key_request: KeyRequest,
secp: &Secp256k1<C>
) -> Result<Option<PrivateKey>, Self::Error>
fn get_key<C: Signing>( &self, key_request: KeyRequest, secp: &Secp256k1<C> ) -> Result<Option<PrivateKey>, Self::Error>
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.