Trait bitcoin::psbt::GetKey

source ·
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§

source

type Error: Debug

An error occurred while getting the key.

Required Methods§

source

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.

Implementations on Foreign Types§

source§

impl GetKey for HashSet<Xpriv>

§

type Error = GetKeyError

source§

fn get_key<C: Signing>( &self, key_request: KeyRequest, secp: &Secp256k1<C> ) -> Result<Option<PrivateKey>, Self::Error>

source§

impl GetKey for HashMap<PublicKey, PrivateKey>

§

type Error = GetKeyError

source§

fn get_key<C: Signing>( &self, key_request: KeyRequest, _: &Secp256k1<C> ) -> Result<Option<PrivateKey>, Self::Error>

source§

impl GetKey for BTreeMap<PublicKey, PrivateKey>

§

type Error = GetKeyError

source§

fn get_key<C: Signing>( &self, key_request: KeyRequest, _: &Secp256k1<C> ) -> Result<Option<PrivateKey>, Self::Error>

source§

impl GetKey for BTreeSet<Xpriv>

§

type Error = GetKeyError

source§

fn get_key<C: Signing>( &self, key_request: KeyRequest, secp: &Secp256k1<C> ) -> Result<Option<PrivateKey>, Self::Error>

Implementors§