Questions tagged [jwk]

A JSON Web Key is a JSON data structure that represents a cryptographic key.

A JSON Web Key (JWK) is a JavaScript Object Notation (JSON) data structure that represents a cryptographic key.

The specification for this structure is in RFC 7517.

218 questions
2
votes
1 answer

How to validate a firebase token with python_jwt

I've searched for any real examples that take a token from a firebase session and actually verify it. I saw some examples using python-jose, but wanted a working example using python_jwt. There's a lot of examples that decode it, but none that I saw…
Terry Hardie
  • 101
  • 1
  • 4
2
votes
1 answer

How to invalidate cache of RemoteJWKSet in nimbus-jose-jwt

We are making use of RemoteJWKSet in nimbus-jose-jwt third party library for JWKS endpoint based JWT validation. With RemoteJWKSet, we can retrieve the JWKS from a remote endpoint and the retrieved JWK set is cached in order to to minimize network…
sathya
  • 523
  • 1
  • 4
  • 18
2
votes
1 answer

Is it a bad idea to cache auth0 JWK

I am using auth0, and I have two clients (ios, react) and a Go backend API using go-auth0. I followed the documentation and made a Verify method that looks like this: func Verify(handle httprouter.Handle) httprouter.Handle { return func(w…
user1354934
  • 8,139
  • 15
  • 50
  • 80
2
votes
1 answer

What value to set as 'kid' in JWT header

As per the JWK specification 'kid' is defined as follows. The "kid" (key ID) parameter is used to match a specific key. This is used, for instance, to choose among a set of keys within a JWK Set during key rollover. The structure of the "kid"…
sathya
  • 523
  • 1
  • 4
  • 18
2
votes
1 answer

How should you save a jwk?

I hope this is not a naive question but how should you save a jwk when getting it from a .well-known/jwks.json domain. Currently I hard code the modulus and exponent but that doesn't seem to be a great solution. Adding it to a database seems…
test
  • 107
  • 12
2
votes
1 answer

How to generate a JWT/JWS with JWE

I am developing a j2ee authentication/authorization system. I want to use JWT tokens, sign the payload with JWS and encrypt it using JWE. I found a decent tutorial from bitbuckets jose4j This example shows them generating a JWK using…
Nick H
  • 8,897
  • 9
  • 41
  • 64
2
votes
2 answers

Selecting a key in a JWKS given a JWT header

Is there a standard way of selecting a signature verification key in a JWKS key store given a JWS (JWT) header? My goal is to implement OpenID Connect ID Token validation library and I'm trying to be flexible and anticipate different configurations…
maciekszajna
  • 325
  • 1
  • 4
  • 9
2
votes
2 answers

Parsing crypto ECDH public key into JWK format to use it with WebCrypto

I generated an ECDH key pair, and get the public key from it. Using nodejs and the crypto library. const ecdh = crypto.createECDH('secp384r1'); ecdh.generateKeys(); const publicKey = ecdh.getPublicKey('hex'); I'm implementing a client side…
Nicolas Del Valle
  • 1,384
  • 15
  • 20
2
votes
0 answers

How to convert JWE JSON to PEM

I want to convert JWE JSON into PEM format. I am using OpenSSL with Elliptic Curve Cryptography. Here is JSON {"kty":"EC","crv":"P-256","x":"0FwHzpaCfb2Assd1LA3kX9_UssnhX_XuciyZ0sdDMpLuPNk","y":"gf67dENsd12GnxEvABuDoZVbVw4KQ5kD9sduH7bCWPVI8aE"} Now…
Ankit Thakur
  • 4,739
  • 1
  • 19
  • 35
1
vote
0 answers

How to create JWKs endpoint with pre existing base64 p12 keystore in Nodejs

I am working to create JWKs endpoint for a Nodejs application which can be used by another application to access public key. I only have access to base64 encoded keystore (.p12) and password in application source code. Found related solutions using…
Rishu Vaid
  • 61
  • 5
1
vote
1 answer

How does JWK EC public key co-ordinate encoding work?

I'm attempting to re-create a P-521 JWK from just the private key. According to the spec (section 4.2.1): "The x member contains the x coordinate for the elliptic curve point. It is represented as the base64url encoding of the coordinate's…
knaccc
  • 232
  • 2
  • 11
1
vote
1 answer

How to convert JWK to PEM in NodeJS/Typescript

I'd like to download public key from jwk endpoint and convert it into pem format that is required in sing function for jwt. export type Secret = | string | Buffer | { key: string | Buffer; passphrase: string }; The jwk format can be…
Milan Baran
  • 4,133
  • 2
  • 32
  • 49
1
vote
2 answers

Spring Oauth2 Authorization Server - How to use multiples JWK Keys

I have a requirement in my system that in some flows I have to use a JWT with a specific private/public key and other flows have to user another JWT with other keys. I'm using spring oauth2 authorization server 1.0.0. When I try to set two keys, it…
Mark
  • 41
  • 1
  • 4
1
vote
1 answer

How to include x5t and x5c in JWK output?

I am trying to call some APIs published by the IRS. They require me to create a JWK and send them the public key. I was able to generate an RSA JWK key using this code: package com.propfinancing.jwk; import com.nimbusds.jose.jwk.KeyUse; import…
Neil
  • 153
  • 1
  • 9
1
vote
1 answer

How to generate a JWK from a PEM encoded public key in Java?

I have a PEM encoded public key and want to generate a JWK key from it in Java. This is what I tried: -----BEGIN PUBLIC…
stwissel
  • 20,110
  • 6
  • 54
  • 101