Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for JWKs with EC key type #371

Merged
merged 5 commits into from Dec 1, 2020

Commits on Nov 30, 2020

  1. Add support for JWKs with EC key type

    Adds support for JWKs with "kty" value "EC".  This commit includes
    support for curves ("crv") "P-256", "P-384", "P-521".
    
    For additional details on these JWKs and their contents, see
    https://tools.ietf.org/html/rfc7518#section-6.2.1.
    
    This implementation adheres closely to the pattern set by
    `JWT::JWK::RSA`.  It keeps the same coding style and method names.
    It also inherits a few quirks:
    - It ignores any private key ("d") values when importing JWKs.
    - It never emits private key ("d") values when exporting JWKs.
    - An import followed by an export does not preserve the "kid" value.
    
    These behaviors seem strange to me, but I worry that changing the
    convention would be surprising and potentially dangerous to existing
    users of this library.
    richardlarocque committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    7541997 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6672386 View commit details
    Browse the repository at this point in the history
  3. Add support for kid in JWT::JWK::EC

    Updates the implementation of JWT:JWK::EC so it will import and
    export custom "kid" values.
    
    See also jwt#320, which proposes
    doing the same for JWT::JWK::RSA.
    richardlarocque committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    5a629a6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    fce0cd7 View commit details
    Browse the repository at this point in the history
  5. Rebase JWT::JWK::EC and add private key export

    Updates `JWT::JWK::EC` to extend `KeyBase` and support other conventions
    like the `JWT::JWK::KTYS` array.
    
    Adds support for `#export(include_private: true)` to `JWT::JWK::EC` and
    updates tests to match the new behavior.
    richardlarocque committed Nov 30, 2020
    Configuration menu
    Copy the full SHA
    162f256 View commit details
    Browse the repository at this point in the history