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.