![]() Establish a new distributed CMake architecture with CMake code related to a source directory moving to be in the subdir in its own CMakeLists.txt. In particular, there's now one in ./lib which calls through to ones further down the directory tree like ./lib/plat/xxx, ./lib/roles/xxx etc. This cuts the main CMakelists.txt from 98KB -> 33KB, about a 66% reduction, and it's much easier to maintain sub-CMakeLists.txt that are in the same directory as the sources they manage, and conceal all the details that that level. Child CMakelists.txt become responsible for: - include_directories() definition (this is not supported by CMake directly, it passes it back up via PARENT_SCOPE vars in helper macros) - Addition child CMakeLists.txt inclusion, for example toplevel -> role -> role subdir - Source file addition to the build - Dependent library path resolution... this is now a private thing in the child CMakeLists.txt, it just passes back any adaptations to include_directories() and the LIB_LIST without filling the parent namespace with the details |
||
---|---|---|
.. | ||
jwe | ||
jwk | ||
jws | ||
CMakeLists.txt | ||
private-lib-jose.h | ||
README.md |
JOSE support
JOSE is a set of web standards aimed at encapsulating crypto operations flexibly inside JSON objects.
Lws provides lightweight apis to performs operations on JWK, JWS and JWE independent of the tls backend in use. The JSON parsing is handled by the lws lejp stream parser.
Part | RFC | Function |
---|---|---|
JWS | RFC7515 | JSON Web Signatures |
JWE | RFC7516 | JSON Web Encryption |
JWK | RFC7517 | JSON Web Keys |
JWA | RFC7518 | JSON Web Algorithms |
JWA is a set of recommendations for which combinations of algorithms are deemed desirable and secure, which implies what must be done for useful implementations of JWS, JWE and JWK.
Supported algorithms
Supported keys
-
All RFC7517 / JWK forms: octet, RSA and EC
-
singleton and keys[] arrays of keys supported
Symmetric ciphers
- All common AES varaiants: CBC, CFB128, CFB8, CTR, EVB, OFB, KW and XTS
Asymmetric ciphers
-
RSA
-
EC (P-256, P-384 and P-521 JWA curves)
Payload auth and crypt
- AES_128_CBC_HMAC_SHA_256
- AES_192_CBC_HMAC_SHA_384
- AES_256_CBC_HMAC_SHA_512
- AES_128_GCM
For the required and recommended asymmetric algorithms, support currently looks like this
JWK kty | JWA | lws |
---|---|---|
EC | Recommended+ | yes |
RSA | Required | yes |
oct | Required | yes |
JWE alg | JWA | lws |
---|---|---|
RSA1_5 | Recommended- | yes |
RSA-OAEP | Recommended+ | no |
ECDH-ES | Recommended+ | no |
JWS alg | JWA | lws |
---|---|---|
HS256 | Required | yes |
RS256 | Recommended+ | yes |
ES256 | Recommended | yes |
Minimal Example tools
API tests
See ./minimal-examples/api-tests/api-test-jose/
for example test code.
The tests are built and confirmed during CI.