pub struct AlgorithmReading<'a> { /* private fields */ }Expand description
Original algorithm fields plus a recoverable parameter-syntax diagnostic.
A malformed reading is inspection data, not valid BER/DER or a provider
input. Only Self::identifier can expose a validated identifier. No input
bytes are copied and the diagnostic itself has no allocated storage.
use structured_pkix::algorithm::{AlgorithmIdentifier, AlgorithmReading};
fn crypto_input(_: AlgorithmIdentifier<'_>) {}
fn unchecked(reading: AlgorithmReading<'_>) {
crypto_input(reading); // Inspection data is not a validated identifier.
}Implementations§
Source§impl<'a> AlgorithmReading<'a>
impl<'a> AlgorithmReading<'a>
Sourcepub fn algorithm(&self) -> Oid<'a>
pub fn algorithm(&self) -> Oid<'a>
The original, successfully decoded OID; not a supported capability.
Sourcepub fn parameters(&self) -> Option<&'a [u8]>
pub fn parameters(&self) -> Option<&'a [u8]>
The whole original parameter encoding, including any malformed form.
Sourcepub fn parameters_span(&self) -> Option<Span>
pub fn parameters_span(&self) -> Option<Span>
Original parameter range in the producing reader’s coordinates. Joined content requires its caller-owned source map for physical ranges.
Sourcepub fn has_null_parameter(&self) -> bool
pub fn has_null_parameter(&self) -> bool
A primitive NULL whose complete parameter validation succeeded. A malformed form, including constructed NULL, never has this fact.
Sourcepub fn as_bytes(&self) -> &'a [u8] ⓘ
pub fn as_bytes(&self) -> &'a [u8] ⓘ
Whole original algorithm encoding, including an original IMPLICIT tag.
Sourcepub fn encoding(&self) -> Encoding
pub fn encoding(&self) -> Encoding
Encoding used by the producing reader, without a replacement parser.
Sourcepub fn same_session(&self, parent: &Reader<'_>) -> bool
pub fn same_session(&self, parent: &Reader<'_>) -> bool
Whether this inspection reading belongs to the supplied parser session. This checks original provenance even when no validated identifier exists; account identity alone does not establish source/session identity.
Sourcepub fn fault(&self) -> Option<&Error>
pub fn fault(&self) -> Option<&Error>
Parameter syntax fault; resource and processing failures are never here.
Sourcepub fn identifier(&self) -> Option<AlgorithmIdentifier<'a>>
pub fn identifier(&self) -> Option<AlgorithmIdentifier<'a>>
A validated identifier only when the complete parameter check succeeded. Selected-provider parameter/profile acceptance still belongs to that provider.
Sourcepub fn require_identifier(&self) -> Result<AlgorithmIdentifier<'a>>
pub fn require_identifier(&self) -> Result<AlgorithmIdentifier<'a>>
Requires a validated provider input, returning the original syntax fault. This is a scalar provenance check; no reparse, allocation or parameter normalization is performed. Selected-provider acceptance is separate.
Sourcepub fn same_written_in(&self, other: &Self, parent: &Reader<'_>) -> Result<bool>
pub fn same_written_in(&self, other: &Self, parent: &Reader<'_>) -> Result<bool>
Paid written-value identity for inspection, not parameter acceptance. Malformed parameters retain exact encoded identity; only two validated primitive NULL values can ignore their BER length spelling. Absence is never inferred as a default. Both readings require this producing parser.