secure-types 0.3.0

Secure data types that protect sensitive data in memory via locking and zeroization.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use secure_types::SecureArray;

#[allow(deprecated)]

fn main() {
   let sec_array = SecureArray::from_slice(&[1, 2, 3]).unwrap();

   // Direct access to the locked memory region will cause a segfault
   let ptr = sec_array.ptr();
   unsafe {
      core::ptr::read_volatile(ptr.as_ptr());
   }
}