Trait holochain_types::prelude::AgentPubKeyExt
source · pub trait AgentPubKeyExt {
// Required methods
fn new_random(
keystore: &MetaLairClient
) -> MustBoxFuture<'static, Result<HoloHash<Agent>, OneErr>>
where Self: Sized;
fn sign_raw(
&self,
keystore: &MetaLairClient,
data: Arc<[u8]>
) -> MustBoxFuture<'static, Result<Signature, OneErr>>;
fn verify_signature_raw(
&self,
signature: &Signature,
data: Arc<[u8]>
) -> MustBoxFuture<'static, Result<bool, KeystoreError>>;
// Provided methods
fn sign<S>(
&self,
keystore: &MetaLairClient,
input: S
) -> MustBoxFuture<'static, Result<Signature, OneErr>>
where S: Serialize + Debug { ... }
fn verify_signature<D>(
&self,
signature: &Signature,
data: D
) -> MustBoxFuture<'static, Result<bool, KeystoreError>>
where D: TryInto<SerializedBytes, Error = SerializedBytesError> { ... }
}
Expand description
Extend holo_hash::AgentPubKey with additional signature functionality from Keystore.
Required Methods§
sourcefn new_random(
keystore: &MetaLairClient
) -> MustBoxFuture<'static, Result<HoloHash<Agent>, OneErr>>where
Self: Sized,
fn new_random(
keystore: &MetaLairClient
) -> MustBoxFuture<'static, Result<HoloHash<Agent>, OneErr>>where
Self: Sized,
create a new agent keypair in given keystore, returning the AgentPubKey
sourcefn sign_raw(
&self,
keystore: &MetaLairClient,
data: Arc<[u8]>
) -> MustBoxFuture<'static, Result<Signature, OneErr>>
fn sign_raw( &self, keystore: &MetaLairClient, data: Arc<[u8]> ) -> MustBoxFuture<'static, Result<Signature, OneErr>>
sign some arbitrary raw bytes
sourcefn verify_signature_raw(
&self,
signature: &Signature,
data: Arc<[u8]>
) -> MustBoxFuture<'static, Result<bool, KeystoreError>>
fn verify_signature_raw( &self, signature: &Signature, data: Arc<[u8]> ) -> MustBoxFuture<'static, Result<bool, KeystoreError>>
verify a signature for given raw bytes with this agent public_key is valid
Provided Methods§
sourcefn sign<S>(
&self,
keystore: &MetaLairClient,
input: S
) -> MustBoxFuture<'static, Result<Signature, OneErr>>
fn sign<S>( &self, keystore: &MetaLairClient, input: S ) -> MustBoxFuture<'static, Result<Signature, OneErr>>
sign some arbitrary data
sourcefn verify_signature<D>(
&self,
signature: &Signature,
data: D
) -> MustBoxFuture<'static, Result<bool, KeystoreError>>
fn verify_signature<D>( &self, signature: &Signature, data: D ) -> MustBoxFuture<'static, Result<bool, KeystoreError>>
verify a signature for given data with this agent public_key is valid
Object Safety§
This trait is not object safe.