Skip to main content

random_request_nonce

Function random_request_nonce 

Source
pub fn random_request_nonce() -> Result<RequestNonce, CratestackError>
Expand description

A fresh Cratestack-Nonce: 16 bytes from the operating system’s CSPRNG. Fails with CratestackError::Internal if it is unavailable.

The default nonce source of CoseEnvelope::request_nonce, for a client that sends an unsigned request it wants a verifiable response to. Here and not on RequestNonce (which cratestack-core defines) since the second #1006 review (decision B-1): drawing it needs getrandom, and only this crate selects that crate’s wasm32-unknown-unknown backend. It replaces 0.13.0’s RequestNonce::random().