Code structure

The code structure of joserfc follows an organized approach based on RFC specifications. It is designed to enhance understanding by grouping the code according to specific RFCs.


The overall structure is organized as follows:

  rfc7515/          # Code related to RFC7515 (JWS)
  rfc7516/          # Code related to RFC7516 (JWE)
  rfc7517/          # Code related to RFC7517 (JWK)
  rfc7518/          # Code related to RFC7518 (JWA)
  rfc7519/          # Code related to RFC7519 (JWT)
  rfc7638/          # Code related to RFC7638 (JWK Thumbprint)
  rfc8037/          # Code related to RFC8037 (OKP Keys)
  rfc8812/          # Code related to RFC8812 (secp256k1 Curve)            # High-level API for JWS operations            # High-level API for JWE operations            # High-level API for JWK operations            # High-level API for JWT operations

This structure allows developers to easily navigate and comprehend each RFC specification individually. The code is organized from low-level to high-level, making it intuitive and convenient to understand and use. Developers can utilize the higher-level APIs (,,, without needing to delve into the lower-level implementation details.

By following this structured approach, joserfc ensures clarity, ease of understanding, and simplicity in both comprehension and utilization of the library.

New RFCs

To add a new RFC implementation to joserfc, you can follow a straightforward approach:

  1. Create a new folder within the joserfc package, named after the RFC number.

  2. Place the relevant code files and modules related to the new RFC within the created folder.

  3. Organize the code structure within the folder to align with the RFC’s specifications and guidelines.

  4. Update the necessary high-level APIs (,,, to integrate and expose the new RFC implementation.

By adhering to this approach, you can easily incorporate new RFC implementations into joserfc, maintaining a well-organized and extensible codebase.

Draft RFCs

Draft RFCs are specifications that are still in the draft phase and subject to potential changes. In joserfc, draft implementations are placed within the joserfc.drafts package. It’s important to note that draft implementations are not typically accepted as part of the main joserfc library until the RFC is officially published and stabilized.

Although draft implementations are included within the joserfc.drafts package for exploration and experimentation purposes, they may not fully adhere to the final version of the RFC. It is recommended to use caution when relying on draft implementations, as they may undergo significant changes or be incompatible with the final RFC specification.