Struct fog_crypto::stream::ContainedStreamKey[][src]

pub struct ContainedStreamKey { /* fields omitted */ }

A self-contained implementor of StreamInterface. It’s expected this will be used unless the symmetric key is being managed by the OS or a hardware module.

Implementations

impl ContainedStreamKey[src]

pub fn generate<R>(csprng: &mut R) -> Self where
    R: CryptoRng + RngCore
[src]

Generate a new key, given a cryptographic RNG.

pub fn with_version<R>(csprng: &mut R, version: u8) -> Result<Self, CryptoError> where
    R: CryptoRng + RngCore
[src]

Generate a new key with a specific version, given a cryptographic RNG. Fails if the version isn’t supported.

pub fn encode_vec(&self, buf: &mut Vec<u8>)[src]

Encode directly to a byte vector. The resulting vector should be zeroized or overwritten before being dropped.

Trait Implementations

impl Drop for ContainedStreamKey[src]

impl StreamInterface for ContainedStreamKey[src]

impl TryFrom<&'_ [u8]> for ContainedStreamKey[src]

type Error = CryptoError

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,