[][src]Struct pwbox::RestoredPwBox

pub struct RestoredPwBox { /* fields omitted */ }

Password-encrypted box restored after deserialization.

If the box may be corrupted, it may make sense to check its length with the Self::len() method before opening the box.

Implementations

impl RestoredPwBox[src]

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

Returns the byte size of the encrypted data stored in this box.

pub fn open_into(
    &self,
    output: impl AsMut<[u8]>,
    password: impl AsRef<[u8]>
) -> Result<(), Error>
[src]

Decrypts the box into the specified container.

This method should be preferred to open() if the output type implements zeroing on drop (e.g., cryptographic secrets from sodiumoxide).

pub fn open(&self, password: impl AsRef<[u8]>) -> Result<SensitiveData, Error>[src]

Decrypts the box and returns its contents. The returned container is zeroed on drop and derefs to a byte slice.

Trait Implementations

impl Debug for RestoredPwBox[src]

Auto Trait Implementations

impl !RefUnwindSafe for RestoredPwBox

impl !Send for RestoredPwBox

impl !Sync for RestoredPwBox

impl Unpin for RestoredPwBox

impl !UnwindSafe for RestoredPwBox

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> Same<T> for T

type Output = T

Should always be Self

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.