[][src]Trait parsec::SecretId

pub trait SecretId {
    type PublicId: PublicId;
    fn public_id(&self) -> &Self::PublicId;
fn sign_detached(
        &self,
        data: &[u8]
    ) -> <Self::PublicId as PublicId>::Signature;
fn encrypt<M: AsRef<[u8]>>(
        &self,
        to: &Self::PublicId,
        msg: M
    ) -> Option<Vec<u8>>;
fn decrypt(&self, from: &Self::PublicId, ct: &[u8]) -> Option<Vec<u8>>; fn create_proof(&self, data: &[u8]) -> Proof<Self::PublicId> { ... } }

The secret identity of a node. It provides functionality to allow it to be used as an asymmetric signing secret key and to also yield the associated public identity.

Associated Types

type PublicId: PublicId

The associated public identity type.

Loading content...

Required methods

fn public_id(&self) -> &Self::PublicId

Returns the associated public identity.

fn sign_detached(&self, data: &[u8]) -> <Self::PublicId as PublicId>::Signature

Creates a detached Signature of data.

fn encrypt<M: AsRef<[u8]>>(
    &self,
    to: &Self::PublicId,
    msg: M
) -> Option<Vec<u8>>

Encrypts the message using own Rng to to

fn decrypt(&self, from: &Self::PublicId, ct: &[u8]) -> Option<Vec<u8>>

Decrypt message from from.

Loading content...

Provided methods

fn create_proof(&self, data: &[u8]) -> Proof<Self::PublicId>

Creates a Proof of data.

Loading content...

Implementors

Loading content...