pub struct AlgorithmName { /* private fields */ }alloc only.Expand description
A string representing an additional algorithm name in the name@domainname format (see
RFC4251 § 6).
Additional algorithm names must be non-empty printable ASCII strings no longer than 64 characters.
This also provides a name-cert-v01@domainnname string identifier for the corresponding
OpenSSH certificate format, derived from the specified name@domainname string.
NOTE: RFC4251 specifies additional validation criteria for algorithm names, but we do not implement all of them here.
Implementations§
Source§impl AlgorithmName
impl AlgorithmName
Sourcepub fn new(id: impl Into<String>) -> Result<Self, LabelError>
pub fn new(id: impl Into<String>) -> Result<Self, LabelError>
Create a new algorithm identifier.
§Errors
Returns LabelError in the event the identifier is invalid.
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Get the string identifier which corresponds to this algorithm name.
Sourcepub fn certificate_type(&self) -> String
pub fn certificate_type(&self) -> String
Get the string identifier which corresponds to the OpenSSH certificate format.
Sourcepub fn from_certificate_type(id: &str) -> Result<Self, LabelError>
pub fn from_certificate_type(id: &str) -> Result<Self, LabelError>
Create a new AlgorithmName from an OpenSSH certificate format string identifier.
§Errors
Returns LabelError in the event the identifier is invalid.
Trait Implementations§
Source§impl Clone for AlgorithmName
impl Clone for AlgorithmName
Source§fn clone(&self) -> AlgorithmName
fn clone(&self) -> AlgorithmName
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AlgorithmName
impl Debug for AlgorithmName
Source§impl FromStr for AlgorithmName
impl FromStr for AlgorithmName
Source§impl Hash for AlgorithmName
impl Hash for AlgorithmName
Source§impl Ord for AlgorithmName
impl Ord for AlgorithmName
Source§fn cmp(&self, other: &AlgorithmName) -> Ordering
fn cmp(&self, other: &AlgorithmName) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AlgorithmName
impl PartialEq for AlgorithmName
Source§fn eq(&self, other: &AlgorithmName) -> bool
fn eq(&self, other: &AlgorithmName) -> bool
self and other values to be equal, and is used by ==.