Struct fog_pack::types::IdentityLockboxRef[][src]

pub struct IdentityLockboxRef(_);
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.

This is only a reference to an encrypted payload. The owned version is IdentityLockbox.

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: &IdentityLockboxRef = IdentityLockboxRef::from_bytes(&enc[..])?;
let recipient: LockboxRecipient = dec_lockbox.recipient();
// ...
// Retrieve the key by looking up recipient
// ...
let dec_key: IdentityKey = key.decrypt_identity_key(&dec_lockbox)?;

Implementations

Decompose the lockbox into its component parts.

Get the stream encryption version.

Get the target recipient who can decrypt this.

The raw bytestream, suitable for serialization.

Trait Implementations

Immutably borrows from an owned value. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more