pub struct AttachmentDecryptionStream { /* private fields */ }Expand description
Incremental authenticated decryption for a private staged destination.
update returns unauthenticated plaintext bytes. The host must write them
only to a private temporary destination and must delete that destination
unless Self::finish authenticates the final tag. No plaintext may be
displayed, indexed, or atomically published before that success.
Implementations§
Source§impl AttachmentDecryptionStream
impl AttachmentDecryptionStream
Sourcepub fn new(key_bytes: Vec<u8>, nonce: Vec<u8>) -> Result<Self, SoftchatError>
pub fn new(key_bytes: Vec<u8>, nonce: Vec<u8>) -> Result<Self, SoftchatError>
Start decryption from the 12-byte combined-format prefix.
§Errors
Returns a stable failure for an invalid key or nonce length.
Sourcepub fn update(&self, ciphertext: Vec<u8>) -> Result<Vec<u8>, SoftchatError>
pub fn update(&self, ciphertext: Vec<u8>) -> Result<Vec<u8>, SoftchatError>
Decrypt one bounded ciphertext chunk into private staged bytes.
§Errors
Returns a stable failure after finish/cancel or when bounds are exceeded.
Sourcepub fn finish(
&self,
authentication_tag: Vec<u8>,
) -> Result<AttachmentStreamFinal, SoftchatError>
pub fn finish( &self, authentication_tag: Vec<u8>, ) -> Result<AttachmentStreamFinal, SoftchatError>
Authenticate the final 16-byte tag before an atomic staged-file move.
§Errors
Returns a stable decryption failure for a wrong key, tampering, invalid tag length, cancellation, or repeated finish.
Trait Implementations§
Source§impl Debug for AttachmentDecryptionStream
impl Debug for AttachmentDecryptionStream
Source§impl<UT> LiftRef<UT> for AttachmentDecryptionStream
impl<UT> LiftRef<UT> for AttachmentDecryptionStream
Source§impl<UT> LowerError<UT> for AttachmentDecryptionStream
impl<UT> LowerError<UT> for AttachmentDecryptionStream
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for AttachmentDecryptionStream
impl<UT> LowerReturn<UT> for AttachmentDecryptionStream
Source§type ReturnType = <Arc<AttachmentDecryptionStream> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<AttachmentDecryptionStream> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for AttachmentDecryptionStream
impl<UT> TypeId<UT> for AttachmentDecryptionStream
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl !Freeze for AttachmentDecryptionStream
impl RefUnwindSafe for AttachmentDecryptionStream
impl Send for AttachmentDecryptionStream
impl Sync for AttachmentDecryptionStream
impl Unpin for AttachmentDecryptionStream
impl UnsafeUnpin for AttachmentDecryptionStream
impl UnwindSafe for AttachmentDecryptionStream
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
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more