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
8
votes
3 answers

How to generate a JSON Web Key (JWK) in C#

I need to generate JSON Web Key (jwk) using C# as shown. I have gone through a few articles but there were implementations in other languages such as Java and there was a third-party library (Nimbus JOSE+JWT library and so). Could you please help me…
Simant
  • 3,142
  • 4
  • 32
  • 61
7
votes
2 answers

How to decode JWT token with JWK in Python

I am developing an application where all the API's are protected by OAuth. I have received the access token from the client, but could not decode and validate the token. I have JWK in the below format { "keys": [ { "kty": "RSA", …
Nikesh Kedlaya
  • 652
  • 4
  • 10
  • 30
7
votes
1 answer

.Net Core JwtBearer middleware using Amazon Cognito

I am using Cognito(using the amazon-javascript-sdk) in a .net Core angular application and im trying to verify the access_token that i get from amazon in my .net core back-end so that I can protect my Web Api. Using the Amazon cognito JWKS I am able…
blaataap
  • 219
  • 2
  • 12
7
votes
1 answer

how to generate encrypted JWE with node-jose

I'm using node-jose v0.11.0 (https://www.npmjs.com/package/node-jose) for JWK and JWE operations. I have an RSA key in JWK format that I can load into a JWK key store and also extract again. However, when I try to encrypt anything, I get into the…
Ollyblink
  • 123
  • 1
  • 1
  • 10
6
votes
2 answers

Converting JWK json into a public key golang (lestrrat-go)

I'm using JWKS format to provide from an authentication service the public key that can be used to validate tokens coming from that authentication service. However, to perform validation I need to rebuild the public key from the JWK. How can I…
AndreaCostanzo1
  • 1,799
  • 1
  • 12
  • 30
6
votes
2 answers

How to validate signature of JWT from jwks without x5c

I have a JWT security token which I need to verify via jwks endpoint. Data in jwks looks like: { "keys": [ { "kty": "RSA", "e": "AQAB", "use": "sig", "alg": "RS256", "n": "......", "kid":…
Kamran Shahid
  • 3,954
  • 5
  • 48
  • 93
6
votes
0 answers

How to use a public JWK for ECDH algorithm on iOS 9 and above

I am having problems using a public EC key in JWK format in Objective C with CommonCrypto. I have a java example of what I can't seem to do in Objective C. This is pulled from the Nimbus Jose JWT library at…
6
votes
1 answer

How to create JWK from RSA Key pair?

Suppose I have a python structure representing an RSA key pair as follows: rsa_key_pair = { 'private_key': '-----BEGIN PRIVATE KEY-----\nMIIEvAIBADAN__OBSCURED__qxu3sWAlY/bstTB5WfX8PA==\n-----END PRIVATE KEY-----\n', 'public_key': 'ssh-rsa…
Saqib Ali
  • 11,931
  • 41
  • 133
  • 272
6
votes
1 answer

com.nimbusds.jose.RemoteKeySourceException: Couldn't retrieve remote JWK set: Hostname verification failed

I am using Nimbus-JOSE-JWT library library (version 4.39). Using this library, I am trying to do local JWT token validation which pulls down JWK set from the OAuth authorization server. My code works perfectly fine when I run it within a JSE…
Khalid Anwar
  • 61
  • 1
  • 2
5
votes
1 answer

How to verify a JWT signature using Node-jose

I am trying to use node-jose to verify signatures of my JWTs. I know the secret, but am having trouble converting this secret into a JWK used for the verification. Here is an example of how I am trying to create my key with my secret and verify my…
plum 0
  • 652
  • 9
  • 21
5
votes
1 answer

Quarkus verifying JWTs from multiple sources

Is there a way to allow JWTs from multiple sources? I have a REST API that I only allow access to via Bearer Tokens authentication, and I really only need to verify these tokens, so I don't really need all the additions that OIDC brings. Let's say I…
oole
  • 342
  • 3
  • 13
5
votes
1 answer

How to extract public key from a JWKS using openssl library over shell

I fetched JWKS from an endpoint and it looks something like this: { "keys": [ { "kty": "RSA", "use": "sig", "x5t": "M2maFm3VYlMBOn3GetVWGXkrKrk", "kid": "SIGNING_KEY", "x5c": "MIIC………(base64 encoded…
user
  • 51
  • 2
5
votes
2 answers

Generating Public Key from JWK

Suppose I have the following JWK as the deserialised body of some JWS (RFC7515), where the modulus n is partially omitted for display purposes { "kty": "RSA", "e": "AQAB", "kid": "KAgNpWbRyy9Mf2rikl498LThMrvkbZWHVSQOBC4VHU4", "n":…
Scott
  • 1,863
  • 2
  • 24
  • 43
5
votes
1 answer

How to Validate JWT using JWK for ES256 alg?

I have JWT as var signedJwt =…
5
votes
1 answer

Rails - How to get public key from JSON web keys?

I obtained the following jwks from the server "keys": [ { "kty": "RSA", "e": "AQAB", "use": "sig", "alg": "RS256", "kid": "92595710205972640", "n":…
chocku
  • 53
  • 1
  • 4
1
2
3
14 15