Trait fog_crypto::identity::SignInterface[][src]

pub trait SignInterface {
    fn id(&self) -> &Identity;
fn sign(&self, hash: &Hash) -> Signature;
fn self_export_lock(
        &self,
        csprng: &mut dyn CryptoSrc,
        receive_lock: &LockId
    ) -> Option<IdentityLockbox>;
fn self_export_stream(
        &self,
        csprng: &mut dyn CryptoSrc,
        receive_stream: &StreamKey
    ) -> Option<IdentityLockbox>; }

A Signature interface, implemented by anything that can hold a private cryptographic signing key.

An implementor must handle all supported cryptographic signing algorithms.

Required methods

fn id(&self) -> &Identity[src]

Get the corresponding Identity for the private key.

fn sign(&self, hash: &Hash) -> Signature[src]

Sign a hash.

fn self_export_lock(
    &self,
    csprng: &mut dyn CryptoSrc,
    receive_lock: &LockId
) -> Option<IdentityLockbox>
[src]

Export the signing key in an IdentityLockbox, with receive_lock as the recipient. If the key cannot be exported, this should return None.

fn self_export_stream(
    &self,
    csprng: &mut dyn CryptoSrc,
    receive_stream: &StreamKey
) -> Option<IdentityLockbox>
[src]

Export the signing key in an IdentityLockbox, with receive_stream as the recipient. If the key cannot be exported, this should return None. Additionally, if the underlying implementation does not allow moving the raw key into memory (i.e. it cannot call StreamInterface::encrypt or lock_id_encrypt) then None can also be returned.

Loading content...

Implementors

impl SignInterface for ContainedIdKey[src]

Loading content...