feat: add secrets
This commit is contained in:
12
__security/secrets/src/main.rs
Normal file
12
__security/secrets/src/main.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use secrets::Secret;
|
||||
|
||||
fn main() {
|
||||
Secret::<[u8; 16]>::random(|s| {
|
||||
// use `s` as if it were a `&mut [u8; 16]`
|
||||
//
|
||||
// the memory is `mlock(2)`ed and will be zeroed when this closure
|
||||
// exits
|
||||
println!("{:?}", s);
|
||||
println!("{:?}", *s);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user