admin管理员组

文章数量:1313094

I'm trying to make a node script verify a JWT token. I have the public key (it's a x.509 certificate) and the JWT.

I tried using but unfortunately it seems that they don't support x.509.

If you know of a package that verifies JWT tokens with x.509 certs I would appreciate it.

Thanks!

I'm trying to make a node script verify a JWT token. I have the public key (it's a x.509 certificate) and the JWT.

I tried using https://github./auth0/node-jsonwebtoken but unfortunately it seems that they don't support x.509.

If you know of a package that verifies JWT tokens with x.509 certs I would appreciate it.

Thanks!

Share Improve this question asked Mar 1, 2016 at 17:35 Y. BrahimiY. Brahimi 732 silver badges7 bronze badges 2
  • jsrsasign maybe? – Joachim Isaksson Commented Mar 1, 2016 at 17:49
  • you can try the wrapper around jsjws – tergd1 Commented Mar 1, 2016 at 17:51
Add a ment  | 

1 Answer 1

Reset to default 6

JWT can be signed with public/private keys. The method you are looking for is this one: https://github./auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback

This tests show examples of how to use it:

https://github./auth0/node-jsonwebtoken/blob/master/test/jwt.rs.tests.js

You can also use http://jwt.io

本文标签: javascriptHow do you verify a JWT token with a x509 certificate in nodeStack Overflow