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 Types§

Required Associated Constants§

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>

Implementors§