Trait bitcoin::psbt::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§

type Error: Debug

An error occurred while getting the key.

Required Methods§

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.

Implementations on Foreign Types§

§

impl GetKey for HashMap<PublicKey, PrivateKey, RandomState>

§

impl GetKey for HashSet<ExtendedPrivKey, RandomState>

§

type Error = GetKeyError

§

fn get_key<C>( &self, key_request: KeyRequest, secp: &Secp256k1<C> ) -> Result<Option<PrivateKey>, <HashSet<ExtendedPrivKey, RandomState> as GetKey>::Error>where C: Signing,

§

impl GetKey for BTreeMap<PublicKey, PrivateKey, Global>

§

type Error = GetKeyError

§

fn get_key<C>( &self, key_request: KeyRequest, _: &Secp256k1<C> ) -> Result<Option<PrivateKey>, <BTreeMap<PublicKey, PrivateKey, Global> as GetKey>::Error>where C: Signing,

§

impl GetKey for BTreeSet<ExtendedPrivKey, Global>

§

type Error = GetKeyError

§

fn get_key<C>( &self, key_request: KeyRequest, secp: &Secp256k1<C> ) -> Result<Option<PrivateKey>, <BTreeSet<ExtendedPrivKey, Global> as GetKey>::Error>where C: Signing,

Implementors§

§

impl GetKey for ExtendedPrivKey