[−][src]Struct pwbox::PwBox
Password-encrypted data.
See also
See the crate docs for an example of usage. See ErasedPwBox for serialization details.
Implementations
impl<K: DeriveKey + Default, C: Cipher> PwBox<K, C>[src]
pub fn new<R: RngCore + CryptoRng>(
rng: &mut R,
password: impl AsRef<[u8]>,
message: impl AsRef<[u8]>
) -> Result<Self>[src]
rng: &mut R,
password: impl AsRef<[u8]>,
message: impl AsRef<[u8]>
) -> Result<Self>
Creates a new box by using default settings of the supplied KDF.
impl<K: DeriveKey, C: Cipher> PwBox<K, C>[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]
&self,
output: impl AsMut<[u8]>,
password: impl AsRef<[u8]>
) -> Result<(), Error>
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
Auto Trait Implementations
impl<K, C> RefUnwindSafe for PwBox<K, C> where
C: RefUnwindSafe,
K: RefUnwindSafe,
C: RefUnwindSafe,
K: RefUnwindSafe,
impl<K, C> Send for PwBox<K, C> where
C: Send,
K: Send,
C: Send,
K: Send,
impl<K, C> Sync for PwBox<K, C> where
C: Sync,
K: Sync,
C: Sync,
K: Sync,
impl<K, C> Unpin for PwBox<K, C> where
C: Unpin,
K: Unpin,
C: Unpin,
K: Unpin,
impl<K, C> UnwindSafe for PwBox<K, C> where
C: UnwindSafe,
K: UnwindSafe,
C: UnwindSafe,
K: UnwindSafe,
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,
pub 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> Same<T> for T
type Output = T
Should always be Self
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.
pub 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>,