Struct fog_pack::types::LockLockboxRef [−][src]
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
impl LockLockboxRef[src]
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.
pub fn from_bytes(buf: &[u8]) -> Result<&LockLockboxRef, CryptoError>[src]
Trait Implementations
impl Borrow<LockLockboxRef> for LockLockbox[src]
pub fn borrow(&self) -> &LockLockboxRef[src]
impl Debug for LockLockboxRef[src]
impl<'de, 'a> Deserialize<'de> for &'a LockLockboxRef where
'de: 'a, [src]
'de: 'a,
pub fn deserialize<D>(
deserializer: D
) -> Result<&'a LockLockboxRef, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>, [src]
deserializer: D
) -> Result<&'a LockLockboxRef, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
impl Eq for LockLockboxRef[src]
impl<'a> From<&'a LockLockboxRef> for ValueRef<'a>[src]
fn from(v: &'a LockLockboxRef) -> Self[src]
impl Hash for LockLockboxRef[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<LockLockboxRef> for LockLockboxRef[src]
pub fn eq(&self, other: &LockLockboxRef) -> bool[src]
pub fn ne(&self, other: &LockLockboxRef) -> bool[src]
impl Serialize for LockLockboxRef[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 LockLockboxRef[src]
impl StructuralPartialEq for LockLockboxRef[src]
impl ToOwned for LockLockboxRef[src]
type Owned = LockLockbox
The resulting type after obtaining ownership.