Skip to content

Add `ECDSAKey` support to `JWKS`

Compare
Choose a tag to compare
@tanner0101 tanner0101 released this 08 Sep 21:13
6055fe8
This patch was authored and released by @JaapWijnen.
  • Allows to create JWK's using ECDSAKeys
  • Allows use of ECDSAKeys with JWTSigner.
  • Prevents a crash when using the .es384 curve for ECDSAKeys
let key = ECDSAKey.generate(curve: .p384)
let jwks = JWKS(keys: [
   JWK.ecdsa(.es384, identifier: JWKIdentifier(string: "token-kid"), x: key.parameters!.x, y: key.parameters!.y, curve: .p384)
])
let key = ECDSAKey.generate(curve: .p384)
let signer = JWTSigner.es384(key: key)