pub struct IdentityLockbox(/* private fields */);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>§
Sourcepub fn as_parts(&self) -> LockboxParts<'_>
pub fn as_parts(&self) -> LockboxParts<'_>
Decompose the lockbox into its component parts.
Sourcepub fn recipient(&self) -> LockboxRecipient
pub fn recipient(&self) -> LockboxRecipient
Get the target recipient who can decrypt this.
Trait Implementations§
Source§impl Borrow<IdentityLockboxRef> for IdentityLockbox
impl Borrow<IdentityLockboxRef> for IdentityLockbox
Source§fn borrow(&self) -> &IdentityLockboxRef
fn borrow(&self) -> &IdentityLockboxRef
Immutably borrows from an owned value. Read more
Source§impl Clone for IdentityLockbox
impl Clone for IdentityLockbox
Source§fn clone(&self) -> IdentityLockbox
fn clone(&self) -> IdentityLockbox
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IdentityLockbox
impl Debug for IdentityLockbox
Source§impl Deref for IdentityLockbox
impl Deref for IdentityLockbox
Source§type Target = IdentityLockboxRef
type Target = IdentityLockboxRef
The resulting type after dereferencing.
Source§impl<'de> Deserialize<'de> for IdentityLockbox
impl<'de> Deserialize<'de> for IdentityLockbox
Source§fn deserialize<D>(
deserializer: D,
) -> Result<IdentityLockbox, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<IdentityLockbox, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<IdentityLockbox> for Value
impl From<IdentityLockbox> for Value
Source§fn from(v: IdentityLockbox) -> Self
fn from(v: IdentityLockbox) -> Self
Converts to this type from the input type.
Source§impl Hash for IdentityLockbox
impl Hash for IdentityLockbox
Source§impl PartialEq for IdentityLockbox
impl PartialEq for IdentityLockbox
Source§impl Serialize for IdentityLockbox
impl Serialize for IdentityLockbox
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
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
Source§impl TryFrom<Value> for IdentityLockbox
impl TryFrom<Value> for IdentityLockbox
impl Eq for IdentityLockbox
impl StructuralPartialEq for IdentityLockbox
Auto Trait Implementations§
impl Freeze for IdentityLockbox
impl RefUnwindSafe for IdentityLockbox
impl Send for IdentityLockbox
impl Sync for IdentityLockbox
impl Unpin for IdentityLockbox
impl UnwindSafe for IdentityLockbox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more