Struct t_rust_less_lib::memguard::SecretBytes [−][src]
pub struct SecretBytes { /* fields omitted */ }
Expand description
Strictly memory protected bytes contain sensitive data.
This implementation borrows a lot of code and ideas from:
- https://crates.io/crates/memsec
- https://crates.io/crates/secrets
- https://download.libsodium.org/doc/memory_management
secrets
is not good enough because it relies on libsodium which breaks the desired
portability of this library (at least at the time of this writing).
memsec
is not
good enough because it focuses on protecting a generic type T
which size is known at
compile-time. In this library we are dealing with dynamic amounts of sensitive data and
there is no point in securing a Vec<u8>
via memsec
… all we would achieve is protecting
the pointer to sensitive data in unsecured space.
Implementations
Copy from slice of bytes.
This is not a regular From implementation because the caller has to ensure that the original bytes are zeroed out (or are already in some secured memspace. This different signature should be a reminder of that.
Trait Implementations
Auto Trait Implementations
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self