Skip to content

Validate JWT with JWK #60

@montorodiaz

Description

@montorodiaz

Hello:

I am using this library to validate a JWT token.

The problem I have is that I start from a JWK token:

 {
   "kty": "RSA",
   "e": "AQAB",
   "use": "next",
   "kid": "xxxxxxx",
   "alg": "RS256",
   "n": "xxxxxx......"
 }

The library allows you to validate the JWT token from a public key:

const char *rs_pub_key =
"-----BEGIN PUBLIC KEY-----\n"
.....
"-----END PUBLIC KEY-----";

i'm not sure how to convert the JWK token to public key in the c language. I have tried his online converter:

https://8gwifi.org/jwkconvertfunctions.jsp

and the JWT converted to public key works well with the library.

Could you give me some guidance to convert JWK to public key?

thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions