Trait fog_crypto::identity::SignInterface
source · pub trait SignInterface {
// Required methods
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>;
}
Expand description
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§
sourcefn self_export_lock(
&self,
csprng: &mut dyn CryptoSrc,
receive_lock: &LockId
) -> Option<IdentityLockbox>
fn self_export_lock( &self, csprng: &mut dyn CryptoSrc, receive_lock: &LockId ) -> Option<IdentityLockbox>
Export the signing key in an IdentityLockbox
, with receive_lock
as the recipient. If
the key cannot be exported, this should return None.
sourcefn self_export_stream(
&self,
csprng: &mut dyn CryptoSrc,
receive_stream: &StreamKey
) -> Option<IdentityLockbox>
fn self_export_stream( &self, csprng: &mut dyn CryptoSrc, receive_stream: &StreamKey ) -> Option<IdentityLockbox>
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.