#[non_exhaustive]pub enum Algorithm {
Dsa,
Ecdsa {
curve: EcdsaCurve,
},
Ed25519,
Rsa {
hash: Option<HashAlg>,
},
SkEcdsaSha2NistP256,
SkEd25519,
Other(AlgorithmName),
}Expand description
SSH key algorithms, i.e. digital signature algorithms used with SSH private/public keys.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Dsa
Digital Signature Algorithm
Ecdsa
Elliptic Curve Digital Signature Algorithm
Fields
curve: EcdsaCurveElliptic curve with which to instantiate ECDSA.
Ed25519
Ed25519
Rsa
RSA
Fields
SkEcdsaSha2NistP256
FIDO/U2F key with ECDSA/NIST-P256 + SHA-256
SkEd25519
FIDO/U2F key with Ed25519
Other(AlgorithmName)
alloc only.Other
Implementations§
Source§impl 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-rsask-ecdsa-sha2-nistp256@openssh.com(FIDO/U2F key)sk-ssh-ed25519@openssh.com(FIDO/U2F key)
Any other algorithms are mapped to the Algorithm::Other variant.
Sourcepub fn new_certificate(id: &str) -> Result<Self>
pub fn new_certificate(id: &str) -> Result<Self>
Decode algorithm from the given string identifier as used by the OpenSSH certificate format.
OpenSSH certificate algorithms end in *-cert-v01@openssh.com.
See PROTOCOL.certkeys for more information.
§Supported algorithms
ssh-rsa-cert-v01@openssh.comssh-dss-cert-v01@openssh.comecdsa-sha2-nistp256-cert-v01@openssh.comecdsa-sha2-nistp384-cert-v01@openssh.comecdsa-sha2-nistp521-cert-v01@openssh.comssh-ed25519-cert-v01@openssh.comsk-ecdsa-sha2-nistp256-cert-v01@openssh.com(FIDO/U2F key)sk-ssh-ed25519-cert-v01@openssh.com(FIDO/U2F key)
Any other algorithms are mapped to the Algorithm::Other variant.
Sourcepub fn to_certificate_type(&self) -> String
Available on crate feature alloc only.
pub fn to_certificate_type(&self) -> String
alloc only.Get the string identifier which corresponds to the OpenSSH certificate format.
OpenSSH certificate algorithms end in *-cert-v01@openssh.com.
See PROTOCOL.certkeys for more information.
Sourcepub fn is_ed25519(self) -> bool
pub fn is_ed25519(self) -> bool
Is the algorithm Ed25519?
Trait Implementations§
Source§impl Ord for Algorithm
impl Ord for Algorithm
Source§impl PartialOrd for Algorithm
impl PartialOrd for Algorithm
impl Eq for Algorithm
impl Label for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnwindSafe for Algorithm
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Encode for Twhere
T: Label,
impl<T> Encode for Twhere
T: Label,
Source§fn encoded_len(&self) -> Result<usize, Error>
fn encoded_len(&self) -> Result<usize, Error>
Source§fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode(&self, writer: &mut impl Writer) -> Result<(), Error>
Writer.Source§fn encoded_len_prefixed(&self) -> Result<usize, Error>
fn encoded_len_prefixed(&self) -> Result<usize, Error>
uint32 length prefix.Source§fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
fn encode_prefixed(&self, writer: &mut impl Writer) -> Result<(), Error>
uint32 length prefix
set to Encode::encoded_len.