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: boolWhether the response must carry the TSA certificate.
extensions: &'a [RequestExtension<'a>]New extensions, in caller order; duplicate identifiers are rejected.
Implementations§
Source§impl NewRequest<'_>
impl NewRequest<'_>
Sourcepub fn encode_der(
&self,
parent: &Reader<'_>,
) -> Result<OwnedVec<u8>, RequestEncodingError>
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