[][src]Struct fog_pack::crypto::Lockbox

pub struct Lockbox { /* fields omitted */ }

A container for either a StreamKey, Key, or Value. Can be encrypted for a particular Identity, or for a particular StreamKey

Implementations

impl Lockbox[src]

pub fn get_version(&self) -> u8[src]

Get what version of Key/StreamKey was used in encrypting the Lockbox

pub fn uses_stream(&self) -> bool[src]

Returns true if the Lockbox was encrypted with a StreamKey

pub fn uses_identity(&self) -> bool[src]

Returns true if the Lockbox was encrypted with an Identity

pub fn get_stream(&self) -> Option<StreamKey>[src]

Get the StreamKey used for encrypting the Lockbox. Returns None if an Identity was used instead.

pub fn get_id(&self) -> Option<Identity>[src]

Get the Identity used for encrypting the Lockbox. Returns None if a StreamKey was used instead.

pub fn len(&self) -> usize[src]

Get the length of the Lockbox when it is binary-encoded

pub fn encode(&self, buf: &mut Vec<u8>)[src]

Encode a Lockbox into a byte stream. Does not encode length data itself

pub fn decode(len: usize, buf: &mut &[u8]) -> Result<Lockbox, CryptoError>[src]

Decode a Lockbox from a byte stream. Requires the complete length of the Lockbox that was encoded.

Trait Implementations

impl Clone for Lockbox[src]

impl Debug for Lockbox[src]

impl From<Lockbox> for Value[src]

impl PartialEq<Lockbox> for Lockbox[src]

impl StructuralPartialEq for Lockbox[src]

Auto Trait Implementations

impl RefUnwindSafe for Lockbox

impl Send for Lockbox

impl Sync for Lockbox

impl Unpin for Lockbox

impl UnwindSafe for Lockbox

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.