1 unstable release
0.0.0 | Apr 3, 2020 |
---|
#19 in #persist
3KB
+---------------------+
| |
| Encrypted |
| |
+---------------------+
A wrapper for encrypted data in your program. "Open" data in-place with pluggable encryption backends. This crate is currently empty and will be filled soon!
use encrypted::{Encrypter, Encrypted, DetachedKey};
impl Encrypter for MyKeyType { ... }
impl Detachedkey for MyKeyType {}
fn main() {
let key: Arc<_> = // ... create your encryption key
let mut e = Encrypted::new("Hello!".to_string());
e.close(Arc::clone(&key)).unwrap();
// Now `e` is encrypted
assert_eq!(e.encrypted(), true);
}