pub struct SignedData<'a> { /* private fields */ }Expand description
Original CMS SignedData with independently accounted metadata and faults.
Implementations§
Source§impl<'a> SignedData<'a>
impl<'a> SignedData<'a>
Sourcepub fn read(parser: &'a Parser, encoded: &'a [u8], base: u64) -> Result<Self>
pub fn read(parser: &'a Parser, encoded: &'a [u8], base: u64) -> Result<Self>
Reads one entire CMS ContentInfo and its SignedData using the same parser.
Sourcepub fn read_element(parent: &Reader<'a>, element: &Element<'a>) -> Result<Self>
pub fn read_element(parent: &Reader<'a>, element: &Element<'a>) -> Result<Self>
Reads an original embedded SignedData, preserving enclosing depth/work.
Sourcepub fn required_version(&self) -> u64
pub fn required_version(&self) -> u64
Version independently required by the encoded choices.
Sourcepub fn digest_algorithms(&self) -> &[AlgorithmIdentifier<'a>]
pub fn digest_algorithms(&self) -> &[AlgorithmIdentifier<'a>]
Original advertised digest algorithms; provider resolution is separate. RFC5652 §§5.1, 5.3 permit zero entries and do not require recipients to refuse an unlisted signer digest. These advertisements never replace the original signer algorithm; stricter catalogue acceptance is caller policy. https://www.rfc-editor.org/rfc/rfc5652#section-5.1
Sourcepub fn content(&self) -> &Encapsulated<'a>
pub fn content(&self) -> &Encapsulated<'a>
Original attached or absent content.
Sourcepub fn certificate_choices(&self) -> &[CertificateChoice<'a>]
pub fn certificate_choices(&self) -> &[CertificateChoice<'a>]
Certificate choices in their original order.
Sourcepub fn certificates(&self) -> &[Certificate<'a>]
pub fn certificates(&self) -> &[Certificate<'a>]
Parsed X.509 certificates, in the order referenced by X509 choices.
Sourcepub fn certificate_field(&self) -> Option<Span>
pub fn certificate_field(&self) -> Option<Span>
Original presence of the certificate field, including an empty written set.
Sourcepub fn certificate_choice_reader_in<'query>(
&self,
query: &Reader<'query>,
ordinal: usize,
) -> Result<Option<Reader<'query>>>where
'a: 'query,
pub fn certificate_choice_reader_in<'query>(
&self,
query: &Reader<'query>,
ordinal: usize,
) -> Result<Option<Reader<'query>>>where
'a: 'query,
Opens an original non-X.509 certificate CHOICE under the current query.
Preserves the original parser, encoding, location and certificate-set
depth. The current operation funds new work while original ceilings
remain active. An absent ordinal or X.509 index returns None after
metadata admission; parsed X.509 certificates have their own accessors.
No certificate is implicitly trusted or decoded by opening this reader.
Sourcepub fn revocation_field(&self) -> Option<Span>
pub fn revocation_field(&self) -> Option<Span>
Original presence of the revocation field, including an empty written set.
Sourcepub fn revocations(&self) -> &[Element<'a>]
pub fn revocations(&self) -> &[Element<'a>]
Original revocation choices, not implicitly authenticated or fetched.
Sourcepub fn revocation_reader_in<'query>(
&self,
query: &Reader<'query>,
ordinal: usize,
) -> Result<Option<Reader<'query>>>where
'a: 'query,
pub fn revocation_reader_in<'query>(
&self,
query: &Reader<'query>,
ordinal: usize,
) -> Result<Option<Reader<'query>>>where
'a: 'query,
Opens one original revocation CHOICE under the current query operation.
The reader contains the whole original CRL or other-format CHOICE, not
its contents. Original parser, encoding, location and set-member depth
are preserved; the query may come from another document and pays all
new work/storage while both source and operation ceilings remain active.
No bytes are copied and no new parser or authentication is introduced.
An absent ordinal returns None only after paid metadata admission.
Sourcepub fn signers(&self) -> &[SignerInfo<'a>]
pub fn signers(&self) -> &[SignerInfo<'a>]
Independent signers in their original order, without an all-signers verdict.
Sourcepub fn require_session(
&self,
parent: &Reader<'_>,
field: &'static str,
) -> Result<()>
pub fn require_session( &self, parent: &Reader<'_>, field: &'static str, ) -> Result<()>
Refuses a reader of another parser session.
Sourcepub fn require_signer(
&self,
signer: &SignerInfo<'_>,
field: &'static str,
) -> Result<()>
pub fn require_signer( &self, signer: &SignerInfo<'_>, field: &'static str, ) -> Result<()>
Refuses a SignerInfo that is not one of these signers, by identity.
Constant work: a reference to one of these signers lies inside their storage, so an address range test replaces a scan of every signer.