How latchset/jose works
Project type and purpose
• José is a C-language implementation of the JOSE standards (JWS, JWE, JWK, JWA, JWT, etc.) and provides both a reusable library (libjose) and a command-line utility (jose) that exposes its functionality.
File structure
• Top-level directories
• cmd/ → CLI front-ends (alg, b64, jose, jwe, jwk, jws, fmt)
• lib/ → Core implementation modules (b64, cfg, io, jwe, jwk, jws, hooks, hsh, misc) and embedded crypto providers (lib/openssl, lib/zlib)
• / → Public headers for users of libjose
• tests/ → RFC-compliant test suites and vector files
• doc/ → Doxygen and man-page documentation
• Build files: meson.build, Meson options, GitHub Actions workflow
README for additional insights
• Lists the supported JOSE specs, algorithms, usage examples for key management, signing/verifying, encryption/decryption
• Emphasizes that the library is extensively tested against RFC vectors
a. Main components
1. CLI Layer – individual executables under cmd/
2. Library Layer – libjose core modules
3. Crypto Providers – OpenSSL adaptor, zlib adaptor
4. External Dependencies – jansson (JSON), OpenSSL, zlib
5. Test Harness – invokes CLI and library with RFC vectors
6. Documentation – Doxygen, man pages
b. Relationships & interactions
• CLI executables parse args → invoke high-level API in libjose
• libjose dispatches to sub-modules (b64, cfg, io, jwe, jws, jwk, misc)
• Modules call out to Crypto Providers (OpenSSL for asymmetric/symmetric crypto; zlib for compression)
• I/O module handles file/stdin/stdout; cfg module handles JSON config (via jansson)
• Tests invoke CLI and/or directly call libjose to validate against vectors
c. Architectural patterns and design principles
• Layered architecture: CLI → API → modules → providers
• Modular design: each JOSE spec in its own sub-module
• Adapter pattern: openssl and zlib integrations appear behind uniform provider interfaces
• Build & packaging: Meson build orchestrates compilation, testing, and installation
d. Relevant technologies
• C99 codebase, Meson build system, ninja, GitHub Actions
• External libs: OpenSSL, zlib, jansson
Elements
• Blue for executable/CLI
• Green for library modules
• Yellow for external providers/deps
• Gray for tests/docs