pub trait SignMessage<T>where
    T: SigningTypes,{
    type SignatureData;

    // Required methods
    fn sign_message(&self, message: &[u8]) -> Self::SignatureData;
    fn sign<TPayload, F>(&self, f: F) -> Self::SignatureData
       where F: Fn(&Account<T>) -> TPayload,
             TPayload: SignedPayload<T>;
}
Expand description

A message signer.

Required Associated Types§

type SignatureData

A signature data.

May contain account used for signing and the Signature itself.

Required Methods§

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

Sign a message.

Implementation of this method should return a result containing the signature.

fn sign<TPayload, F>(&self, f: F) -> Self::SignatureDatawhere F: Fn(&Account<T>) -> TPayload, TPayload: SignedPayload<T>,

Construct and sign given payload.

This method expects f to return a SignedPayload object which is then used for signing.

Implementors§

§

impl<T, C> SignMessage<T> for Signer<T, C, ForAll>where T: SigningTypes, C: AppCrypto<<T as SigningTypes>::Public, <T as SigningTypes>::Signature>,

§

impl<T, C> SignMessage<T> for Signer<T, C, ForAny>where T: SigningTypes, C: AppCrypto<<T as SigningTypes>::Public, <T as SigningTypes>::Signature>,