pub struct SecretKey(pub [u8; 32]);
Expand description
SecretKey
for asymmetric authenticated encryption
When a SecretKey
goes out of scope its contents
will be zeroed out
Tuple Fields§
§0: [u8; 32]
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SecretKey
impl<'de> Deserialize<'de> for SecretKey
Source§fn deserialize<D>(
deserializer: D,
) -> Result<SecretKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<SecretKey, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl Index<Range<usize>> for SecretKey
Allows a user to access the byte contents of an object as a slice.
impl Index<Range<usize>> for SecretKey
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[a..b] == y[a..b]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
Source§impl Index<RangeFrom<usize>> for SecretKey
Allows a user to access the byte contents of an object as a slice.
impl Index<RangeFrom<usize>> for SecretKey
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[a..] == y[a..]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
Source§impl Index<RangeFull> for SecretKey
Allows a user to access the byte contents of an object as a slice.
impl Index<RangeFull> for SecretKey
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[] == y[]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.
Source§impl Index<RangeTo<usize>> for SecretKey
Allows a user to access the byte contents of an object as a slice.
impl Index<RangeTo<usize>> for SecretKey
Allows a user to access the byte contents of an object as a slice.
WARNING: it might be tempting to do comparisons on objects
by using x[..b] == y[..b]
. This will open up for timing attacks
when comparing for example authenticator tags. Because of this only
use the comparison functions exposed by the sodiumoxide API.