Skip to main content

Crate jose_rs

Crate jose_rs 

Source
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.