1use std::fmt;
2
3#[derive(Debug, Clone, Eq, PartialEq)]
11pub struct PrivateKey(pub Vec<u8>);
12
13#[derive(Clone, Eq, PartialEq)]
19pub struct Certificate(pub Vec<u8>);
20
21impl AsRef<[u8]> for Certificate {
22 fn as_ref(&self) -> &[u8] {
23 &self.0
24 }
25}
26
27impl fmt::Debug for Certificate {
28 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
29 use super::bs_debug::BsDebug;
30 f.debug_tuple("Certificate")
31 .field(&BsDebug(&self.0))
32 .finish()
33 }
34}
35
36#[cfg(test)]
37mod test {
38 use super::Certificate;
39
40 #[test]
41 fn certificate_debug() {
42 assert_eq!(
43 "Certificate(b\"ab\")",
44 format!("{:?}", Certificate(b"ab".to_vec()))
45 );
46 }
47}