Struct fog_pack::types::IdentityLockbox [−][src]
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>
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<IdentityLockboxRef> for IdentityLockbox[src]
pub fn borrow(&self) -> &IdentityLockboxRef[src]
impl Clone for IdentityLockbox[src]
pub fn clone(&self) -> IdentityLockbox[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for IdentityLockbox[src]
impl Deref for IdentityLockbox[src]
type Target = IdentityLockboxRef
The resulting type after dereferencing.
pub fn deref(&self) -> &<IdentityLockbox as Deref>::Target[src]
impl<'de> Deserialize<'de> for IdentityLockbox[src]
pub fn deserialize<D>(
deserializer: D
) -> Result<IdentityLockbox, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>, [src]
deserializer: D
) -> Result<IdentityLockbox, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Eq for IdentityLockbox[src]
impl From<IdentityLockbox> for Value[src]
fn from(v: IdentityLockbox) -> Self[src]
impl Hash for IdentityLockbox[src]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher, [src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl PartialEq<IdentityLockbox> for IdentityLockbox[src]
pub fn eq(&self, other: &IdentityLockbox) -> bool[src]
pub fn ne(&self, other: &IdentityLockbox) -> bool[src]
impl Serialize for IdentityLockbox[src]
pub fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer, [src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl StructuralEq for IdentityLockbox[src]
impl StructuralPartialEq for IdentityLockbox[src]
impl TryFrom<Value> for IdentityLockbox[src]
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
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>,