[][src]Enum thrussh_keys::key::KeyPair

pub enum KeyPair {
    Ed25519(SecretKey),
    RSA {
        key: Rsa<Private>,
        hash: SignatureHash,
    },
}

Public key exchange algorithms.

Variants

Ed25519(SecretKey)
RSA

Fields of RSA

key: Rsa<Private>hash: SignatureHash

Implementations

impl KeyPair[src]

pub fn clone_public_key(&self) -> PublicKey[src]

Copy the public key of this algorithm.

pub fn name(&self) -> &'static str[src]

Name of this key algorithm.

pub fn generate_ed25519() -> Option<Self>[src]

Generate a key pair.

pub fn generate_rsa(bits: usize, hash: SignatureHash) -> Option<Self>[src]

pub fn sign_detached(&self, to_sign: &[u8]) -> Result<Signature, Error>[src]

Sign a slice using this algorithm.

Trait Implementations

impl Debug for KeyPair[src]

impl PublicKeyBase64 for KeyPair[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.