libepf 0.1.0

Simple framework for secure encrypted communication
Documentation
use chrono::{DateTime, Utc};
use ed25519_dalek::{SigningKey, VerifyingKey};
use std::ops::Add;
use std::time::{Duration, SystemTime};

pub fn pretty_print_date(date: &SystemTime) -> String {
    let datetime: DateTime<Utc> = (*date).into();
    datetime.format("%Y-%m-%dT%H:%M:%S%.f%:z").to_string()
}

pub fn u64_to_st(unix: u64) -> SystemTime {
    SystemTime::UNIX_EPOCH.add(Duration::from_secs(unix))
}

pub fn verifying_key(key: &[u8; 32]) -> VerifyingKey {
    VerifyingKey::from_bytes(key).unwrap()
}
pub fn signing_key(key: &[u8; 64]) -> SigningKey {
    SigningKey::from_keypair_bytes(key).unwrap()
}