Crates.io | encrypted |
lib.rs | encrypted |
version | 0.0.0 |
source | src |
created_at | 2020-04-03 16:08:37.502361 |
updated_at | 2020-04-03 16:08:37.502361 |
description | A type wrapper for encrypted data with hooks to persist it |
homepage | |
repository | |
max_upload_size | |
id | 225968 |
size | 2,036 |
+---------------------+
| |
| 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);
}