-
Enhancements
- Improved handling of RSA private keys in SMF (Straightforward Method) form to CRT (Chinese Remainder Theorem) form, see potatosalad/erlang-jose#19 This is especially useful for keys produced by Java programs using the
RSAPrivateKeySpecAPI as mentioned in Section 9.3 of RFC 7517. - Updated EdDSA operations to comply with draft 04 of draft-ietf-jose-cfrg-curves-04.
- Improved handling of RSA private keys in SMF (Straightforward Method) form to CRT (Chinese Remainder Theorem) form, see potatosalad/erlang-jose#19 This is especially useful for keys produced by Java programs using the
-
Fixes
- Fixed compression encoding bug for
{"zip":"DEF"}operations (thanks to @amadden734 see #3)
- Fixed compression encoding bug for
-
Enhancements
- Support for
JOSE::JWK::Setfor key sets.
- Support for
-
Fixes
- Many of the file writing operations for
JOSE::JWKhave been fixed.
- Many of the file writing operations for
-
Enhancements
- Test coverage is now slightly above 90%.
- Removed legacy support for 32-byte Ed448 and Ed448ph secret keys.
- Improved behavior of ECDH-ES encryption.
-
Fixes
- X25519 uses RbNaCl when available.
- Various argument order fixes.
- Enhancements
- Documentation! Many thanks to @soumyaray for the motivation to improve documentation.
- Support for OpenSSH octet key pairs (for Ed25519).
- Better key management behavior associated with ECDH-ES algorithms.
- Fixes
- Fix bug with PBES2 based encryption.
- Enhancements
- Added merge functions:
JOSE::JWE#mergeJOSE::JWK#mergeJOSE::JWS#mergeJOSE::JWT#merge
- Added block_encryptor and signer functions:
JOSE::JWK#block_encryptorJOSE::JWK#signer
- Support for
"alg","enc", and"use"on keys.
- Added merge functions:
Examples of new functionality:
# Let's generate a 64 byte octet key
jwk = JOSE::JWK.generate_key([:oct, 64])
# => {"k"=>"FXSy7PufOayusvfyKQzdxCegm7yWIMp1b0LD13v57Nq2wF_B-fcr7LDOkufDikmFFsVYWLgrA2zEB--_qqDn3g", "kty"=>"oct"}
# Based on the key's size and type, a default signer (JWS) can be determined
jwk.signer
# => {"alg"=>"HS512"}
# Based on the key's size and type, a default encryptor (JWE) can be determined
jwk.block_encryptor
# => {"alg"=>"dir", "enc"=>"A256CBC-HS512"}
# Keys can be generated based on the signing algorithm (JWS)
JOSE::JWS.generate_key({'alg' => 'HS256'})
# => {"alg"=>"HS256", "k"=>"UuP3Tw2xbGV5N3BGh34cJNzzC2R1zU7i4rOnF9A8nqY", "kty"=>"oct", "use"=>"sig"}
# Keys can be generated based on the encryption algorithm (JWE)
JOSE::JWE.generate_key({'alg' => 'dir', 'enc' => 'A128GCM'})
# => {"alg"=>"dir", "enc"=>"A128GCM", "k"=>"8WNdBjXXwg6QTwrrOnvEPw", "kty"=>"oct", "use"=>"enc"}
# Example of merging a map into an existing JWS (also works with JWE, JWK, and JWT)
jws = JOSE::JWS.from({'alg' => 'HS256'})
jws.merge({'typ' => 'JWT'})
# => {"alg"=>"HS256", "typ"=>"JWT"}- Enhancements
- Add
JOSE.__crypto_fallback__which can be set directly or with theJOSE_CRYPTO_FALLBACKenvironment variable. EdDSA and EdDH algorithms not natively supported are disabled by default. - Support OKP key type with the following curves:
- Support SHA-3 functions for use with
Ed448andEd448ph. - Add
JOSE::JWK#shared_secretfor computing the shared secret between twoECorOKPkeys.
- Add
-
Initial Release
-
Algorithm Support
- JSON Web Encryption (JWE) RFC 7516
"alg"RFC 7518 Section 4RSA1_5RSA-OAEPRSA-OAEP-256A128KWA192KWA256KWdirECDH-ESECDH-ES+A128KWECDH-ES+A192KWECDH-ES+A256KWA128GCMKWA192GCMKWA256GCMKWPBES2-HS256+A128KWPBES2-HS384+A192KWPBES2-HS512+A256KW
"enc"RFC 7518 Section 5A128CBC-HS256A192CBC-HS384A256CBC-HS512A128GCMA192GCMA256GCM
"zip"RFC 7518 Section 7.3DEF
- JSON Web Key (JWK) RFC 7517
"alg"RFC 7518 Section 6ECRSAoct
- JSON Web Signature (JWS) RFC 7515
"alg"RFC 7518 Section 3HS256HS384HS512RS256RS384RS512ES256ES384ES512PS256PS384PS512none
- JSON Web Encryption (JWE) RFC 7516