1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Pure-Rust JSON Object Signing and Encryption (JOSE) primitives.
//!
//! The crate provides JSON Web Signature (JWS), JSON Web Encryption (JWE),
//! JSON Web Key (JWK), and JSON Web Token (JWT) APIs backed by software keys
//! and optional PKCS#11 keys. Algorithms are represented by typed enums, and
//! higher-level JWK APIs bind key metadata to signing, verification,
//! encryption, and decryption operations.
//!
//! Optional crate features enable post-quantum algorithms, deprecated JOSE
//! algorithms needed for legacy interoperability, and PKCS#11 support.
/// Error and result types returned by JOSE operations.
/// JSON Web Signature compact and JSON serialization APIs.
pub use ;
pub use ;
pub use JoseHeader;
pub use JwkOp;
/// Minimum RSA modulus size in bits required by RFC 7518 §3.3 / §4.2.
pub const MIN_RSA_BITS: usize = 2048;
/// Maximum token length (in bytes) accepted by the JWS and JWE decoders.
///
/// Caps memory allocation from an attacker-supplied oversized token — the
/// decoders refuse any input longer than this before any base64url or
/// JSON decoding runs. Set to 1 MiB, which comfortably exceeds any
/// realistic JOSE token (RFC 7519 §2 notes that JWTs are compact
/// precisely to fit HTTP Authorization headers, URLs, and POST bodies).
pub const MAX_TOKEN_BYTES: usize = 1024 * 1024;