ssh_keys/
lib.rs

1//! Public and private key parser
2//!
3//! The only key format supported so far is ``openssh``.
4//!
5//! [Docs](https://docs.rs/ssh-keys/) |
6//! [Github](https://github.com/tailhook/ssh-keys/) |
7//! [Crate](https://crates.io/crates/ssh-keys)
8//!
9#![warn(missing_docs)]
10#![warn(missing_debug_implementations)]
11
12extern crate base64;
13extern crate byteorder;
14#[macro_use] extern crate quick_error;
15
16mod error;
17mod debug;
18mod stdimpls;
19mod conversion;
20pub mod openssh;
21
22pub use error::Error;
23
24/// Public key enum
25pub enum PublicKey {
26    /// RSA key
27    #[allow(missing_docs)]
28    Rsa { exponent: Vec<u8>, modulus: Vec<u8> },
29    /// Ed25519 (eliptic curves) key
30    Ed25519([u8; 32]),
31}
32
33/// Secret key enum
34pub enum PrivateKey {
35    /// RSA key
36    #[allow(missing_docs)]
37    Rsa { n: Vec<u8>, e: Vec<u8>, d: Vec<u8>, iqmp: Vec<u8>,
38          p: Vec<u8>, q: Vec<u8> },
39    /// Ed25519 (eliptic curves) key
40    Ed25519([u8; 64]),
41}