Skip to main content

ContractSignerProvider

Trait ContractSignerProvider 

Source
pub trait ContractSignerProvider {
    type Signer: ContractSigner;

    // Required methods
    fn derive_signer_key_id(
        &self,
        is_offer_party: bool,
        temp_id: [u8; 32],
    ) -> [u8; 32];
    fn derive_contract_signer(
        &self,
        key_id: [u8; 32],
    ) -> Result<Self::Signer, Error>;
    fn get_secret_key_for_pubkey(
        &self,
        pubkey: &PublicKey,
    ) -> Result<SecretKey, Error>;
    fn get_new_secret_key(&self) -> Result<SecretKey, Error>;
}
Expand description

Derives a ContractSigner from a ContractSignerProvider and a contract_keys_id.

Required Associated Types§

Source

type Signer: ContractSigner

A type which implements ContractSigner

Required Methods§

Source

fn derive_signer_key_id( &self, is_offer_party: bool, temp_id: [u8; 32], ) -> [u8; 32]

Create a keys id for deriving a Signer.

Source

fn derive_contract_signer( &self, key_id: [u8; 32], ) -> Result<Self::Signer, Error>

Derives the private key material backing a Signer.

Source

fn get_secret_key_for_pubkey( &self, pubkey: &PublicKey, ) -> Result<SecretKey, Error>

Get the secret key associated with the provided public key.

Only used for Channels.

Source

fn get_new_secret_key(&self) -> Result<SecretKey, Error>

Generate a new secret key and store it in the wallet so that it can later be retrieved.

Only used for Channels.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§