Expand description
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.
Re-exports§
pub use algorithm::JweAlgorithm;pub use algorithm::JweEncryption;pub use algorithm::JwsAlgorithm;pub use authenticated::Authenticated;pub use error::ErrorCategory;pub use error::JoseError;pub use error::Result;pub use header::JoseHeader;pub use jwk::JwkOp;pub use password::Password;
Modules§
- algorithm
- JOSE algorithm identifiers and mapping to kryptering enums.
- authenticated
- Values that arrived under authentication, and the header that came with them.
- base64url
- Base64url encoding/decoding (RFC 4648 §5, no padding).
- capability
- Read-only capability reporting (L0).
- error
- Error and result types returned by JOSE operations. Error and result types for JOSE operations.
- header
- JOSE Header (shared between JWS and JWE).
- jwe
- JWE (JSON Web Encryption) – RFC 7516.
- jwk
- JSON Web Key (JWK) types and serialization (RFC 7517).
- jws
- JSON Web Signature compact and JSON serialization APIs. JSON Web Signature (JWS) signing, verification, and certificate binding.
- jwt
- JWT (JSON Web Token) — RFC 7519.
- password
- A password, owned, zeroized, and distinguishable from a key at compile time.
Constants§
- MAX_
KEY_ DER_ BYTES - Maximum DER size accepted by key import entry points.
- MAX_
RSA_ BITS - Maximum RSA modulus size accepted or generated by this crate.
- MAX_
TOKEN_ BYTES - Maximum token length (in bytes) accepted by the JWS and JWE decoders.
- MIN_
RSA_ BITS - Minimum RSA modulus size in bits required by RFC 7518 §3.3 / §4.2.
- SIGNATURE_
VERIFICATION_ FAILED - The exact message raised when a signature fails to verify.