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>
impl<'r, 'a> Encrypted<'r, 'a>
Sourcepub fn read(
certificate: &'r AttributeCertificate<'a>,
parent: &Reader<'a>,
) -> Result<Option<Self>>
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.
Sourcepub fn envelopes(&self) -> &[EnvelopedData<'a>]
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.
Sourcepub 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>>
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());