pub struct RequestNonce<'a>(/* private fields */);Expand description
Caller-generated nonce for a new RFC9654 request. Construction validates size only; the caller must use a cryptographically strong random generator.
Implementations§
Source§impl<'a> RequestNonce<'a>
impl<'a> RequestNonce<'a>
Sourcepub fn from_sent(bytes: &'a [u8]) -> Result<Self, NonceSizeError>
pub fn from_sent(bytes: &'a [u8]) -> Result<Self, NonceSizeError>
Retain an actual sent wire nonce for comparison, including legacy short requests. RFC9654 §2.1 permits received sizes 1..128; generation of a new compliant request must still use at least 32 strong random octets. Invalid input is an error, not an absent request nonce. https://www.rfc-editor.org/rfc/rfc9654#section-2.1
Sourcepub fn new(bytes: &'a [u8]) -> Option<Self>
pub fn new(bytes: &'a [u8]) -> Option<Self>
Validate a newly generated request value. RFC9654 §2.1 requires new requesters to use at least 32 octets; the schema maximum is 128. This is not a check of the bytes’ randomness. https://www.rfc-editor.org/rfc/rfc9654#section-2.1
Trait Implementations§
Source§impl<'a> Clone for RequestNonce<'a>
impl<'a> Clone for RequestNonce<'a>
impl<'a> Copy for RequestNonce<'a>
Auto Trait Implementations§
impl<'a> Freeze for RequestNonce<'a>
impl<'a> RefUnwindSafe for RequestNonce<'a>
impl<'a> Send for RequestNonce<'a>
impl<'a> Sync for RequestNonce<'a>
impl<'a> Unpin for RequestNonce<'a>
impl<'a> UnsafeUnpin for RequestNonce<'a>
impl<'a> UnwindSafe for RequestNonce<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more