Verify signature of JSON Web Token


#1

Hi,

I am using AWS Cognito and I need to verify signature of JSON Web Token with JSON Web Key (JWK), which looks like this

{
		"kid": "5678example=",
		"alg": "RS256",
		"kty": "RSA",
		"e": "AQAB",
		"n": "987654321",
		"use": "sig"
	}

https://docs.aws.amazon.com/en_us/cognito/latest/developerguide/amazon-cognito-user-pools-using-tokens-verifying-a-jwt.html
JSONWebTokens.jl pkg has signature verification function but it needs pem file and not JWK. I didn’t find Julia’s equivalent to JS jwk-to-pem pkg. Is there a way to build pem from such JWK in Julia (perhaps, with MbedTLS) or are there any other solutions here (except calling NodeJS from Julia)?