Trait solana_sdk::signer::Signer

source ·
pub trait Signer {
    // Required methods
    fn try_pubkey(&self) -> Result<Pubkey, SignerError>;
    fn try_sign_message(&self, message: &[u8]) -> Result<Signature, SignerError>;
    fn is_interactive(&self) -> bool;

    // Provided methods
    fn pubkey(&self) -> Pubkey { ... }
    fn sign_message(&self, message: &[u8]) -> Signature { ... }
}
Expand description

The Signer trait declares operations that all digital signature providers must support. It is the primary interface by which signers are specified in Transaction signing interfaces

Required Methods§

source

fn try_pubkey(&self) -> Result<Pubkey, SignerError>

Fallibly gets the implementor’s public key

source

fn try_sign_message(&self, message: &[u8]) -> Result<Signature, SignerError>

Fallibly produces an Ed25519 signature over the provided message bytes.

source

fn is_interactive(&self) -> bool

Whether the impelmentation requires user interaction to sign

Provided Methods§

source

fn pubkey(&self) -> Pubkey

Infallibly gets the implementor’s public key. Returns the all-zeros Pubkey if the implementor has none.

source

fn sign_message(&self, message: &[u8]) -> Signature

Infallibly produces an Ed25519 signature over the provided message bytes. Returns the all-zeros Signature if signing is not possible.

Trait Implementations§

source§

impl Debug for dyn Signer

source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> From<T> for Box<dyn Signer>where T: Signer + 'static,

source§

fn from(signer: T) -> Self

Converts to this type from the input type.
source§

impl PartialEq<dyn Signer + 'static> for dyn Signer

source§

fn eq(&self, other: &dyn Signer) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Implementors§