Skip to main content

NewRequest

Struct NewRequest 

Source
pub struct NewRequest<'a> {
    pub algorithm: AlgorithmIdentifier<'a>,
    pub hashed_message: &'a [u8],
    pub policy: Option<Oid<'a>>,
    pub nonce: Option<&'a [u8]>,
    pub cert_req: bool,
    pub extensions: &'a [RequestExtension<'a>],
}
Expand description

New request values. This is a construction input, not a computed imprint receipt or evidence that the chosen hash is permitted. Compute the imprint through the selected provider before supplying its bytes here.

Nonce bytes are an unsigned magnitude, generated by the caller’s entropy source. Empty means zero; None means absent. The encoder never invents a nonce, clock, policy, default algorithm or extension interpretation.

Fields§

§algorithm: AlgorithmIdentifier<'a>

Actual selected hash identifier with its original parameter provenance.

§hashed_message: &'a [u8]

Finished message digest, with the width checked by the selected provider.

§policy: Option<Oid<'a>>

Explicit requested TSA policy, if any.

§nonce: Option<&'a [u8]>

Newly generated unsigned nonce magnitude, without ASN.1 framing.

§cert_req: bool

Whether the response must carry the TSA certificate.

§extensions: &'a [RequestExtension<'a>]

New extensions, in caller order; duplicate identifiers are rejected.

Implementations§

Source§

impl NewRequest<'_>

Source

pub fn encode_der( &self, parent: &Reader<'_>, ) -> Result<OwnedVec<u8>, RequestEncodingError>

Encode one complete DER TimeStampReq. The reader must be from the identifier’s producing session, optionally rebound to current Work. New values are admitted through that joint execution; retained capacity keeps its actual allocation charge after the reader is dropped.

RFC3161 §§2.4.1/3 and X.690 §11.5 require ordered DER fields and omission of DEFAULT FALSE. Parameters must already be DER-conformant; no opaque BER payload is silently rewritten or interpreted as a different hash. https://www.rfc-editor.org/rfc/rfc3161#section-2.4.1

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

impl<'a> Freeze for NewRequest<'a>

§

impl<'a> Unpin for NewRequest<'a>

§

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