Struct fog_crypto::lockbox::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<&Self, CryptoError>[src]
Trait Implementations
impl Borrow<LockLockboxRef> for LockLockbox[src]
fn borrow(&self) -> &LockLockboxRef[src]
impl Debug for LockLockboxRef[src]
impl<'de: 'a, 'a> Deserialize<'de> for &'a LockLockboxRef[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>, [src]
D: Deserializer<'de>,
impl Eq for LockLockboxRef[src]
impl Hash for LockLockboxRef[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
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]
fn eq(&self, other: &LockLockboxRef) -> bool[src]
fn ne(&self, other: &LockLockboxRef) -> bool[src]
impl Serialize for LockLockboxRef[src]
impl StructuralEq for LockLockboxRef[src]
impl StructuralPartialEq for LockLockboxRef[src]
impl ToOwned for LockLockboxRef[src]
type Owned = LockLockbox
The resulting type after obtaining ownership.