public class TokenTool extends Object
| Constructor and Description |
|---|
TokenTool() |
| Modifier and Type | Method and Description |
|---|---|
static String |
createJWTByHMAC256(String key,
String iss,
String sub,
long issuedAtTimeThresholdMs,
long validityPeriodMs) |
static com.auth0.jwt.interfaces.DecodedJWT |
verifierJWTByHMAC256(String key,
String iss,
String sub,
String token)
HMAC256 算法解析 JSON Web Token
|
public static String createJWTByHMAC256(String key, String iss, String sub, long issuedAtTimeThresholdMs, long validityPeriodMs) throws UnsupportedEncodingException
key - 算法密码iss - 发行人sub - 主题issuedAtTimeThresholdMs - 微调 Token 开始时间validityPeriodMs - 有效持续时间UnsupportedEncodingException - 兼容低版本public static com.auth0.jwt.interfaces.DecodedJWT verifierJWTByHMAC256(String key, String iss, String sub, String token) throws com.auth0.jwt.exceptions.JWTVerificationException, UnsupportedEncodingException
key - 算法密码iss - 发行人sub - 主题token - TokenUnsupportedEncodingException - 兼容低版本com.auth0.jwt.exceptions.JWTVerificationExceptionCopyright © 2020. All rights reserved.