1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
extern crate rand;

mod base64 {
    use base64::{DecodeError, Engine, prelude::BASE64_STANDARD};

    /// Encode `input` as the standard base64 with padding.
    pub(crate) fn encode<T: AsRef<[u8]>>(input: T) -> String {
        BASE64_STANDARD.encode(input)
    }

    /// Decode `input` as the standard base64 with padding.
    pub(crate) fn decode<T: AsRef<[u8]>>(input: T) -> Result<Vec<u8>, DecodeError> {
        BASE64_STANDARD.decode(input)
    }
}

#[macro_use]
mod macros;
mod key;

pub use self::key::*;

#[cfg(feature = "private")] mod private;
#[cfg(feature = "private")] pub use self::private::*;

#[cfg(feature = "signed")] mod signed;
#[cfg(feature = "signed")] pub use self::signed::*;