Skip to main content

Encrypted

Struct Encrypted 

Source
pub struct Encrypted<'r, 'a> { /* private fields */ }
Expand description

Complete catalogue of independent original targeted envelopes. Reading all values precedes the first provider call, so malformed later metadata cannot leave a successful decrypted prefix. It authenticates no AC on its own.

Implementations§

Source§

impl<'r, 'a> Encrypted<'r, 'a>

Source

pub fn read( certificate: &'r AttributeCertificate<'a>, parent: &Reader<'a>, ) -> Result<Option<Self>>

Read the original unique encAttrs attribute’s entire value set. Returns None only when this actual AC has no such attribute. Same producing Parser is required before lookup/work, not merely the same account.

Source

pub fn envelopes(&self) -> &[EnvelopedData<'a>]

All original envelopes. Caller inspection of borrowed metadata/bytes must account its own scans; decrypt_all admits all of its own traversal.

Source

pub fn decrypt_all<'p, 'd, 'c, S, P, V, R>( &self, checked: &Checked<'_, 'p, 'd, 'c, S>, parent: &Reader<'_>, provider: impl FnMut(&EnvelopedData<'a>, &Execution<'_>) -> Result<Attempt<OwnedVec<u8>>, P>, visitor: impl for<'scope> FnMut(&Bound<'scope>, &Execution<'_>) -> Result<R, V>, ) -> Result<OwnedVec<Outcome<R>>, DecryptError<P, V>>

Process every independent value through the selected provider and a scoped visitor. Decryption receives original fragmented ciphertext and must admit its backend work/output through the supplied Execution. The returned owned plaintext must belong to that same operation account.

DER parsing inherits the actual ciphertext’s original depth and source and operation ceilings, without a new Parser or copied-buffer reset. Plaintext and parsed models are dropped after the visitor. R/V/P cannot borrow these temporary values. A late error drops all retained R/results; external provider/visitor side effects cannot be rolled back.

The visitor cannot return a borrowed plaintext view. Its higher-ranked scope is the same restriction illustrated here:

ⓘ
use structured_cms::attribute_certificate::encrypted::Bound;
fn scoped<R>(_: impl for<'s> Fn(&Bound<'s>) -> R) {}
scoped(|bound| bound.clear().element().as_bytes());

Auto Trait Implementations§

§

impl<'r, 'a> !Freeze for Encrypted<'r, 'a>

§

impl<'r, 'a> !RefUnwindSafe for Encrypted<'r, 'a>

§

impl<'r, 'a> !Send for Encrypted<'r, 'a>

§

impl<'r, 'a> !Sync for Encrypted<'r, 'a>

§

impl<'r, 'a> !UnwindSafe for Encrypted<'r, 'a>

§

impl<'r, 'a> Unpin for Encrypted<'r, 'a>

§

impl<'r, 'a> UnsafeUnpin for Encrypted<'r, 'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.