Support reading and writing ED25519 SSH keys.

This commit is contained in:
2019-05-22 19:57:20 -07:00
parent d2bdbd37fe
commit 16cf6172ce
3 changed files with 107 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
use base64::DecodeError;
use ed25519::ED25519PublicImportError;
use std::io;
#[derive(Debug)]
@@ -37,6 +38,15 @@ impl From<io::Error> for SSHKeyParseError {
}
}
impl From<ED25519PublicImportError> for SSHKeyParseError {
fn from(e: ED25519PublicImportError) -> SSHKeyParseError {
match e {
ED25519PublicImportError::WrongNumberOfBytes(_) =>
SSHKeyParseError::InvalidPublicKeyMaterial
}
}
}
#[derive(Debug)]
pub enum SSHKeyRenderError {
IOError(io::Error),