pub struct EncryptedPayload(/* private fields */);Expand description
These are detached encrypted bytes, which means they have a 0IRON + IV + CIPHERTEXT.
This value is correct by construction and will be validated when we create it.
There is no public constructor, only the TryFrom implementations.
Implementations§
Source§impl EncryptedPayload
impl EncryptedPayload
Sourcepub fn to_aes_value_with_attached_iv(self) -> IvAndCiphertext
pub fn to_aes_value_with_attached_iv(self) -> IvAndCiphertext
Convert the encrypted payload to t
Sourcepub fn decrypt(self, key: &EncryptionKey) -> Result<PlaintextDocument, Error>
pub fn decrypt(self, key: &EncryptionKey) -> Result<PlaintextDocument, Error>
Decrypt a V5 detached document. The document should have the expected header
pub fn write_to_bytes(&self) -> Vec<u8> ⓘ
Trait Implementations§
Source§impl Clone for EncryptedPayload
impl Clone for EncryptedPayload
Source§fn clone(&self) -> EncryptedPayload
fn clone(&self) -> EncryptedPayload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EncryptedPayload
impl Debug for EncryptedPayload
Source§impl Default for EncryptedPayload
impl Default for EncryptedPayload
Source§fn default() -> EncryptedPayload
fn default() -> EncryptedPayload
Returns the “default value” for a type. Read more
impl Eq for EncryptedPayload
Source§impl From<IvAndCiphertext> for EncryptedPayload
impl From<IvAndCiphertext> for EncryptedPayload
Source§fn from(value: IvAndCiphertext) -> Self
fn from(value: IvAndCiphertext) -> Self
Converts to this type from the input type.
Source§impl PartialEq for EncryptedPayload
impl PartialEq for EncryptedPayload
Source§fn eq(&self, other: &EncryptedPayload) -> bool
fn eq(&self, other: &EncryptedPayload) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EncryptedPayload
Source§impl TryFrom<Bytes> for EncryptedPayload
impl TryFrom<Bytes> for EncryptedPayload
Auto Trait Implementations§
impl !Freeze for EncryptedPayload
impl RefUnwindSafe for EncryptedPayload
impl Send for EncryptedPayload
impl Sync for EncryptedPayload
impl Unpin for EncryptedPayload
impl UnsafeUnpin for EncryptedPayload
impl UnwindSafe for EncryptedPayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more