Struct fog_crypto::lockbox::IdentityLockbox
source · [−]pub struct IdentityLockbox(_);
Expand description
An encrypted IdentityKey
.
This must be decrypted by the matching recipient, which will return the IdentityKey
on
success. It can either be decrypted on its own, returning a temporary IdentityKey
, or
through a Vault, which will store the IdentityKey
.
When decoding, a reference to the data is first created: IdentityLockboxRef
, which can then
be converted with to_owned
to create this struct.
See: StreamKey::decrypt_identity_key
,
LockKey::decrypt_identity_key
, and
Vault::decrypt_identity_key
.
Example
Using a StreamKey
for decryption:
// We have `enc`, a byte vector containing a lockbox
let dec_lockbox: IdentityLockbox = IdentityLockboxRef::from_bytes(&enc[..])?.to_owned();
let recipient: LockboxRecipient = dec_lockbox.recipient();
// ...
// Retrieve the key by looking up recipient
// ...
let dec_key: IdentityKey = key.decrypt_identity_key(&dec_lockbox)?;
Methods from Deref<Target = IdentityLockboxRef>
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 = IdentityLockboxRef
type Target = IdentityLockboxRef
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 IdentityLockbox
impl Send for IdentityLockbox
impl Sync for IdentityLockbox
impl Unpin for IdentityLockbox
impl UnwindSafe for IdentityLockbox
Blanket Implementations
Mutably borrows from an owned value. Read more