age-crypto 0.2.0

A safe, ergonomic Rust wrapper around the age encryption library with strong typing, comprehensive error handling, and passphrase support.
Documentation
1
2
3
4
5
6
7
use crate::errors::Result;
use crate::errors::decrypt::DecryptError;
use std::str::FromStr;
pub(crate) fn parse_identity(secret_key: &str) -> Result<age::x25519::Identity> {
    age::x25519::Identity::from_str(secret_key)
        .map_err(|e| DecryptError::InvalidIdentity(format!("Parse failed: {}", e)).into())
}