ssh_keys/
debug.rs

1use std::fmt;
2
3use {PublicKey, PrivateKey};
4
5impl fmt::Debug for PublicKey {
6    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7        use PublicKey::*;
8        match *self {
9            Rsa { .. } => {
10                // TODO(tailhook) show length
11                write!(f, "PublicKey::Rsa")
12            }
13            Ed25519(..) => {
14                write!(f, "PublicKey::Ed25519")
15            }
16        }
17    }
18}
19
20impl fmt::Debug for PrivateKey {
21    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
22        use PrivateKey::*;
23        match *self {
24            Rsa { .. } => {
25                // TODO(tailhook) show length
26                write!(f, "PrivateKey::Rsa")
27            }
28            Ed25519(..) => {
29                write!(f, "PrivateKey::Ed25519")
30            }
31        }
32    }
33}