Trait KeypairTraits
pub trait KeypairTraits:
Sized
+ From<Self::PrivKey>
+ Signer<Self::Sig>
+ EncodeDecodeBase64
+ FromStr {
type PubKey: VerifyingKey<PrivKey = Self::PrivKey, Sig = Self::Sig>;
type PrivKey: SigningKey<PubKey = Self::PubKey, Sig = Self::Sig>;
type Sig: Authenticator<PubKey = Self::PubKey, PrivKey = Self::PrivKey>;
// Required methods
fn public(&self) -> &Self::PubKey;
fn private(self) -> Self::PrivKey;
fn copy(&self) -> Self;
fn generate<R>(rng: &mut R) -> Self
where R: AllowedRng;
}
Expand description
Trait impl’d by a public / private key pair in asymmetric cryptography.
Required Associated Types§
type PubKey: VerifyingKey<PrivKey = Self::PrivKey, Sig = Self::Sig>
type PrivKey: SigningKey<PubKey = Self::PubKey, Sig = Self::Sig>
type Sig: Authenticator<PubKey = Self::PubKey, PrivKey = Self::PrivKey>
Required Methods§
fn copy(&self) -> Self
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.