Trait holochain_keystore::AgentPubKeyExt

source ·
pub trait AgentPubKeyExt {
    // Required methods
    fn new_random(
        keystore: &MetaLairClient
    ) -> MustBoxFuture<'static, LairResult<AgentPubKey>>
       where Self: Sized;
    fn sign_raw(
        &self,
        keystore: &MetaLairClient,
        data: Arc<[u8]>
    ) -> MustBoxFuture<'static, LairResult<Signature>>;
    fn verify_signature_raw(
        &self,
        signature: &Signature,
        data: Arc<[u8]>
    ) -> MustBoxFuture<'static, bool>;

    // Provided methods
    fn sign<S>(
        &self,
        keystore: &MetaLairClient,
        input: S
    ) -> MustBoxFuture<'static, LairResult<Signature>>
       where S: Serialize + Debug { ... }
    fn verify_signature<D>(
        &self,
        signature: &Signature,
        data: D
    ) -> MustBoxFuture<'static, bool>
       where D: TryInto<SerializedBytes, Error = SerializedBytesError> { ... }
}
Expand description

Extend holo_hash::AgentPubKey with additional signature functionality from Keystore.

Required Methods§

source

fn new_random( keystore: &MetaLairClient ) -> MustBoxFuture<'static, LairResult<AgentPubKey>>
where Self: Sized,

create a new agent keypair in given keystore, returning the AgentPubKey

source

fn sign_raw( &self, keystore: &MetaLairClient, data: Arc<[u8]> ) -> MustBoxFuture<'static, LairResult<Signature>>

sign some arbitrary raw bytes

source

fn verify_signature_raw( &self, signature: &Signature, data: Arc<[u8]> ) -> MustBoxFuture<'static, bool>

verify a signature for given raw bytes with this agent public_key is valid

Provided Methods§

source

fn sign<S>( &self, keystore: &MetaLairClient, input: S ) -> MustBoxFuture<'static, LairResult<Signature>>
where S: Serialize + Debug,

sign some arbitrary data

source

fn verify_signature<D>( &self, signature: &Signature, data: D ) -> MustBoxFuture<'static, bool>

verify a signature for given data with this agent public_key is valid

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AgentPubKeyExt for AgentPubKey

source§

fn new_random( keystore: &MetaLairClient ) -> MustBoxFuture<'static, LairResult<AgentPubKey>>
where Self: Sized,

source§

fn sign_raw( &self, keystore: &MetaLairClient, data: Arc<[u8]> ) -> MustBoxFuture<'static, LairResult<Signature>>

source§

fn verify_signature_raw( &self, signature: &Signature, data: Arc<[u8]> ) -> MustBoxFuture<'static, bool>

Implementors§