Struct fog_pack::types::LockLockboxRef [−][src]
pub struct LockLockboxRef(_);Expand description
An reference to an encrypted LockKey.
This must be decrypted by the matching recipient, which will return the LockKey on success.
It can either be decrypted on its own, returning a temporary LockKey, or through a Vault,
which will store the LockKey.
This is only a reference to an encrypted payload. The owned version is LockLockbox.
See: StreamKey::decrypt_lock_key,
LockKey::decrypt_lock_key, and
Vault::decrypt_lock_key.
Example
Using a StreamKey for decryption:
// We have `enc`, a byte vector containing a lockbox
let dec_lockbox: &LockLockboxRef = LockLockboxRef::from_bytes(&enc[..])?;
let recipient: LockboxRecipient = dec_lockbox.recipient();
// ...
// Retrieve the key by looking up recipient
// ...
let dec_key: LockKey = key.decrypt_lock_key(&dec_lockbox)?;Implementations
Decompose the lockbox into its component parts.
Get the target recipient who can decrypt this.
Trait Implementations
Immutably borrows from an owned value. Read more
pub fn deserialize<D>(
deserializer: D
) -> Result<&'a LockLockboxRef, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
pub fn deserialize<D>(
deserializer: D
) -> Result<&'a LockLockboxRef, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
This method tests for self and other values to be equal, and is used
by ==. Read more
This method tests for !=.
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
type Owned = LockLockbox
type Owned = LockLockbox
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more