[]Struct private_currency::crypto::enc::SecretKey

#[must_use]
pub struct SecretKey(pub [u8; 32]);

SecretKey for asymmetric authenticated encryption

When a SecretKey goes out of scope its contents will be zeroed out

Methods

impl SecretKey

from_slice() creates an object from a byte slice

This function will fail and return None if the length of the byte-slice isn't equal to the length of the object

Trait Implementations

impl Drop for SecretKey

impl<'de> Deserialize<'de> for SecretKey

impl Serialize for SecretKey

impl Debug for SecretKey

impl Eq for SecretKey

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.

The returned type after indexing.

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.

The returned type after indexing.

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.

The returned type after indexing.

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.

The returned type after indexing.

impl PartialEq<SecretKey> for SecretKey

This method tests for !=.

impl Clone for SecretKey

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for SecretKey

impl Sync for SecretKey

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> Erased for T

impl<T> Erased for T

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> SerializeContent for T where
    T: Serialize
[src]

impl<T> Same for T

Should always be Self