Add a display method to the Algorithm struct
This commit is contained in:
parent
c23f2bd573
commit
0b8c0a6195
1 changed files with 11 additions and 0 deletions
|
@ -8,6 +8,17 @@ pub enum Algorithm {
|
|||
Rsa4096Sha256,
|
||||
}
|
||||
|
||||
impl Algorithm {
|
||||
pub fn display(&self) -> String {
|
||||
match self {
|
||||
Self::Ed25519Sha256 => String::from("ed25519-sha256"),
|
||||
Self::Rsa2048Sha256 | Self::Rsa3072Sha256 | Self::Rsa4096Sha256 => {
|
||||
String::from("rsa-sha256")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Algorithm {
|
||||
fn default() -> Self {
|
||||
Self::Rsa2048Sha256
|
||||
|
|
Loading…
Reference in a new issue