#[non_exhaustive]
pub enum Algorithm {
Dsa,
Ecdsa(EcdsaCurve),
Ed25519,
Rsa,
}Expand description
SSH key algorithms.
This type provides a registry of supported digital signature algorithms used for SSH keys.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Dsa
Digital Signature Algorithm
Ecdsa(EcdsaCurve)
Elliptic Curve Digital Signature Algorithm
Ed25519
Ed25519
Rsa
RSA
Implementations
sourceimpl Algorithm
impl Algorithm
sourcepub fn new(id: &str) -> Result<Self>
pub fn new(id: &str) -> Result<Self>
Decode algorithm from the given string identifier.
Supported algorithms
ecdsa-sha2-nistp256ecdsa-sha2-nistp384ecdsa-sha2-nistp521ssh-dssssh-ed25519ssh-rsa
sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Get the string identifier which corresponds to this algorithm.
sourcepub fn is_ed25519(self) -> bool
pub fn is_ed25519(self) -> bool
Is the algorithm Ed25519?
Trait Implementations
sourceimpl Ord for Algorithm
impl Ord for Algorithm
sourceimpl PartialOrd<Algorithm> for Algorithm
impl PartialOrd<Algorithm> for Algorithm
sourcefn partial_cmp(&self, other: &Algorithm) -> Option<Ordering>
fn partial_cmp(&self, other: &Algorithm) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Copy for Algorithm
impl Eq for Algorithm
impl StructuralEq for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnwindSafe for Algorithm
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more