Swift-JWT icon indicating copy to clipboard operation
Swift-JWT copied to clipboard

JSON Web Key

Open crspybits opened this issue 6 years ago • 2 comments

I'm trying to decode a JWT created by Apple-- using a JSON Web Key obtained from-- https://developer.apple.com/documentation/signinwithapplerestapi/fetch_apple_s_public_key_for_verifying_token_signature Apparently, I need to convert from this JSON Web Key to a PEM, to convert to Data and use as input to: let jwtVerifier = JWTVerifier.rs256(publicKey: publicKeyData) Does Swift-JWT enable conversion from a JSON Web Key to a PEM? Thanks!

crspybits avatar Oct 01 '19 21:10 crspybits

OK-- think I've solved my own question: https://github.com/ibm-cloud-security/Swift-JWK-to-PEM

crspybits avatar Oct 01 '19 21:10 crspybits

@crspybits That looks about right.

It would be nice if we could have this functionality directly via the Swift-JWT API. However, we pondered this in the past and didn't make Swift-JWT depend on JWK-to-PEM because, as it stands, that depends on openssl which is not installed by default on macOS.

djones6 avatar Oct 03 '19 13:10 djones6