简体   繁体   English

匹配RSA SHA256的SignatureAlgorithm

[英]SignatureAlgorithm to match RSA SHA256

Salesforce server want to sign jwt with RSA SHA256 - OAuth 2.0 JWT Bearer Token and I cannot find the matching algorithm in io.jsonwebtoken.SignatureAlgorithm lib. Salesforce服务器希望使用RSA SHA256 - OAuth 2.0 JWT承载令牌对jwt进行签名,我无法在io.jsonwebtoken.SignatureAlgorithm库中找到匹配的算法。 SignatureAlgorithm.RS256 description - JWA algorithm name for RSASSA-PKCS-v1_5 using SHA-256 is it the right one? SignatureAlgorithm.RS256描述- JWA algorithm name for RSASSA-PKCS-v1_5 using SHA-256正确吗? Also there are 3 signing methods Jwts.builder() - 还有3种签名方法Jwts.builder() -

JwtBuilder io.jsonwebtoken.JwtBuilder.signWith(SignatureAlgorithm alg, Key key)
JwtBuilder io.jsonwebtoken.JwtBuilder.signWith(SignatureAlgorithm alg, byte[] secretKey)
JwtBuilder io.jsonwebtoken.JwtBuilder.signWith(SignatureAlgorithm alg, String secretKey)

I am not sure which one to use for RSA SHA256 . 我不确定用于RSA SHA256是哪一个。

You have to use HS256. 您必须使用HS256。 Refer this link 引用此链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM