Struct fog_crypto::lockbox::LockLockbox
source · [−]pub struct LockLockbox(_);
Expand description
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
.
When decoding, a reference to the data is first created: LockLockboxRef
, which can then be
converted with to_owned
to create this struct.
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: LockLockbox = LockLockboxRef::from_bytes(&enc[..])?.to_owned();
let recipient: LockboxRecipient = dec_lockbox.recipient();
// ...
// Retrieve the key by looking up recipient
// ...
let dec_key: LockKey = key.decrypt_lock_key(&dec_lockbox)?;
Methods from Deref<Target = LockLockboxRef>
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
type Target = LockLockboxRef
type Target = LockLockboxRef
The resulting type after dereferencing.
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for LockLockbox
impl Send for LockLockbox
impl Sync for LockLockbox
impl Unpin for LockLockbox
impl UnwindSafe for LockLockbox
Blanket Implementations
Mutably borrows from an owned value. Read more