Struct fog_crypto::stream::ContainedStreamKey [−][src]
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]
R: CryptoRng + RngCore,
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]
R: CryptoRng + RngCore,
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]
fn id(&self) -> &StreamId[src]
fn encrypt(
&self,
csprng: &mut dyn CryptoSrc,
lock_type: LockboxType,
content: &[u8]
) -> Vec<u8>[src]
&self,
csprng: &mut dyn CryptoSrc,
lock_type: LockboxType,
content: &[u8]
) -> Vec<u8>
fn decrypt_lock_key(
&self,
lockbox: &LockLockboxRef
) -> Result<LockKey, CryptoError>[src]
&self,
lockbox: &LockLockboxRef
) -> Result<LockKey, CryptoError>
fn decrypt_identity_key(
&self,
lockbox: &IdentityLockboxRef
) -> Result<IdentityKey, CryptoError>[src]
&self,
lockbox: &IdentityLockboxRef
) -> Result<IdentityKey, CryptoError>
fn decrypt_stream_key(
&self,
lockbox: &StreamLockboxRef
) -> Result<StreamKey, CryptoError>[src]
&self,
lockbox: &StreamLockboxRef
) -> Result<StreamKey, CryptoError>
fn decrypt_data(&self, lockbox: &DataLockboxRef) -> Result<Vec<u8>, CryptoError>[src]
fn self_export_lock(
&self,
csprng: &mut dyn CryptoSrc,
receive_lock: &LockId
) -> Option<StreamLockbox>[src]
&self,
csprng: &mut dyn CryptoSrc,
receive_lock: &LockId
) -> Option<StreamLockbox>
fn self_export_stream(
&self,
csprng: &mut dyn CryptoSrc,
receive_stream: &StreamKey
) -> Option<StreamLockbox>[src]
&self,
csprng: &mut dyn CryptoSrc,
receive_stream: &StreamKey
) -> Option<StreamLockbox>
impl TryFrom<&'_ [u8]> for ContainedStreamKey[src]
Auto Trait Implementations
impl RefUnwindSafe for ContainedStreamKey
impl Send for ContainedStreamKey
impl Sync for ContainedStreamKey
impl Unpin for ContainedStreamKey
impl UnwindSafe for ContainedStreamKey
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,