C4Z5NJZGREVN3J2DLLISXR7U3FJGG2YES5RF4LNJ6SL3OWZBMBIQC
}
}
}
/// Named algorithms.
pub trait Named {
/// The name of this algorithm.
fn name(&self) -> &'static str;
}
impl Named for () {
fn name(&self) -> &'static str {
""
}
}
impl Named for PublicKey {
fn name(&self) -> &'static str {
match self {
&PublicKey::Ed25519(_) => ED25519.0,
#[cfg(feature = "openssl")]
&PublicKey::RSA { .. } => SSH_RSA.0,
}
}
}
impl Named for KeyPair {
fn name(&self) -> &'static str {
match self {
&KeyPair::Ed25519 { .. } => ED25519.0,
#[cfg(feature = "openssl")]
&KeyPair::RSA { ref hash, .. } => hash.name().0,
}
}
/// Named algorithms.
pub trait Named {
/// The name of this algorithm.
fn name(&self) -> &'static str;
}
impl Named for () {
fn name(&self) -> &'static str {
""
}
}
#[cfg(not(feature = "openssl"))]
use thrussh_keys::key::ED25519;
#[cfg(feature = "openssl")]
use thrussh_keys::key::{ED25519, SSH_RSA};
impl Named for PublicKey {
fn name(&self) -> &'static str {
match self {
&PublicKey::Ed25519(_) => ED25519.0,
#[cfg(feature = "openssl")]
&PublicKey::RSA { .. } => SSH_RSA.0,
}
impl Named for KeyPair {
fn name(&self) -> &'static str {
match self {
&KeyPair::Ed25519 { .. } => ED25519.0,
#[cfg(feature = "openssl")]
&KeyPair::RSA { ref hash, .. } => hash.name().0,
}
}
}