pub trait SecretId {
type PublicId: PublicId;
// Required methods
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>>;
// Provided method
fn create_proof(&self, data: &[u8]) -> Proof<Self::PublicId> { ... }
}Expand description
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.
Required Associated Types§
Required Methods§
Sourcefn sign_detached(&self, data: &[u8]) -> <Self::PublicId as PublicId>::Signature
fn sign_detached(&self, data: &[u8]) -> <Self::PublicId as PublicId>::Signature
Creates a detached Signature of data.
Provided Methods§
Sourcefn create_proof(&self, data: &[u8]) -> Proof<Self::PublicId>
fn create_proof(&self, data: &[u8]) -> Proof<Self::PublicId>
Creates a Proof of data.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.