AsymmetricKey

Trait AsymmetricKey 

Source
pub trait AsymmetricKey {
    type PubAlg: AsymmetricPublicKey;
    type Secret: AsRef<[u8]> + Clone;

    const SECRET_BECH32_HRP: &'static str;

    // Required methods
    fn generate<T: RngCore + CryptoRng>(rng: T) -> Self::Secret;
    fn compute_public(
        secret: &Self::Secret,
    ) -> <Self::PubAlg as AsymmetricPublicKey>::Public;
    fn secret_from_binary(data: &[u8]) -> Result<Self::Secret, SecretKeyError>;
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn generate<T: RngCore + CryptoRng>(rng: T) -> Self::Secret

Source

fn compute_public( secret: &Self::Secret, ) -> <Self::PubAlg as AsymmetricPublicKey>::Public

Source

fn secret_from_binary(data: &[u8]) -> Result<Self::Secret, SecretKeyError>

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.

Implementors§