4 releases (2 breaking)
0.2.1 | Feb 28, 2024 |
---|---|
0.2.0 | Feb 28, 2024 |
0.1.0 | Feb 28, 2024 |
0.0.1 | Feb 28, 2024 |
#1749 in Cryptography
21 downloads per month
5KB
73 lines
sealed-secrets
Rust library that handles encoding/decoding secrets
lib.rs
:
This module provides functions and traits for saving and loading secrets as strings.
It includes implementations for saving and loading secrets using the SecretsManager
struct.
Example
use sealed_secrets::{encode, decode};
use std::collections::HashMap;
fn main() {
let mut map = HashMap::new();
map.insert("key1".to_string(), "value1".to_string());
map.insert("key2".to_string(), "value2".to_string());
let key = "password".to_string();
let encoded = encode(&map, &key).unwrap();
println!("{}", encoded);
let key = "password".to_string();
let map = decode(&encoded, &key).unwrap();
println!("{:?}", map);
}
Dependencies
~2.7–4MB
~88K SLoC