Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 1.1 KB

File metadata and controls

21 lines (14 loc) · 1.1 KB

Type Alias: AnyJWK

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.

AnyJWK = JWK_EC_Private | JWK_EC_Public | JWK_RSA_Private | JWK_RSA_Public | JWK_OKP_Private | JWK_OKP_Public | JWK_AKP_Private | JWK_AKP_Public | JWK_oct

Discriminated union of the JSON Web Key shapes supported by this module. Unlike JWK, each member requires and fixes the "kty" (Key Type) Parameter to its key type so that the union can be narrowed on it.

Example

let jwk!: jose.AnyJWK

if (jwk.kty === 'EC') {
  console.log(jwk.crv, jwk.x, jwk.y)
}