[−][src]Struct fog_pack::crypto::Lockbox
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]
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,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
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.
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>,