Struct fog_crypto::lockbox::StreamLockbox [−][src]
An encrypted StreamKey.
This must be decrypted by the matching recipient, which will return the StreamKey on
success. It can either be decrypted on its own, returning a temporary StreamKey, or
through a Vault, which will store the StreamKey.
When decoding, a reference to the data is first created: StreamLockboxRef, which can then
be converted with to_owned to create this struct.
See: StreamKey::decrypt_stream_key,
LockKey::decrypt_stream_key, and
Vault::decrypt_stream_key.
Example
Using a StreamKey for decryption (different from the one contained in the lockbox!):
// We have `enc`, a byte vector containing a lockbox let dec_lockbox: StreamLockbox = StreamLockboxRef::from_bytes(&enc[..])?.to_owned(); let recipient: LockboxRecipient = dec_lockbox.recipient(); // ... // Retrieve the key by looking up recipient // ... let dec_key: StreamKey = key.decrypt_stream_key(&dec_lockbox)?;
Methods from Deref<Target = StreamLockboxRef>
pub fn as_parts(&self) -> LockboxParts<'_>[src]
Decompose the lockbox into its component parts.
pub fn version(&self) -> u8[src]
Get the stream encryption version.
pub fn recipient(&self) -> LockboxRecipient[src]
Get the target recipient who can decrypt this.
pub fn as_bytes(&self) -> &[u8][src]
The raw bytestream, suitable for serialization.
Trait Implementations
impl Borrow<StreamLockboxRef> for StreamLockbox[src]
fn borrow(&self) -> &StreamLockboxRef[src]
impl Clone for StreamLockbox[src]
fn clone(&self) -> StreamLockbox[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for StreamLockbox[src]
impl Deref for StreamLockbox[src]
type Target = StreamLockboxRef
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target[src]
impl<'de> Deserialize<'de> for StreamLockbox[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]
D: Deserializer<'de>,
impl Eq for StreamLockbox[src]
impl Hash for StreamLockbox[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl PartialEq<StreamLockbox> for StreamLockbox[src]
fn eq(&self, other: &StreamLockbox) -> bool[src]
fn ne(&self, other: &StreamLockbox) -> bool[src]
impl Serialize for StreamLockbox[src]
impl StructuralEq for StreamLockbox[src]
impl StructuralPartialEq for StreamLockbox[src]
Auto Trait Implementations
impl RefUnwindSafe for StreamLockbox
impl Send for StreamLockbox
impl Sync for StreamLockbox
impl Unpin for StreamLockbox
impl UnwindSafe for StreamLockbox
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
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> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
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>,