最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How do you verify a JWT token with a x.509 certificate in node? - Stack Overflow

programmeradmin0浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论