Skip to main content

AlgorithmReading

Struct AlgorithmReading 

Source
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>

Source

pub fn algorithm(&self) -> Oid<'a>

The original, successfully decoded OID; not a supported capability.

Source

pub fn parameters(&self) -> Option<&'a [u8]>

The whole original parameter encoding, including any malformed form.

Source

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.

Source

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.

Source

pub fn as_bytes(&self) -> &'a [u8] ⓘ

Whole original algorithm encoding, including an original IMPLICIT tag.

Source

pub fn offset(&self) -> u64

Original enclosing algorithm position in the producing source.

Source

pub fn encoding(&self) -> Encoding

Encoding used by the producing reader, without a replacement parser.

Source

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.

Source

pub fn fault(&self) -> Option<&Error>

Parameter syntax fault; resource and processing failures are never here.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl<'a> Debug for AlgorithmReading<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for AlgorithmReading<'a>

§

impl<'a> !Send for AlgorithmReading<'a>

§

impl<'a> !Sync for AlgorithmReading<'a>

§

impl<'a> !UnwindSafe for AlgorithmReading<'a>

§

impl<'a> Freeze for AlgorithmReading<'a>

§

impl<'a> Unpin for AlgorithmReading<'a>

§

impl<'a> UnsafeUnpin for AlgorithmReading<'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.