Class JWTToken
java.lang.Object
com.sankcrm.erp.auth.infrastructure.jwt.JWTToken
- Since:
- 2.1.0
- Author:
- zhsxin
- create time:
- 2023/4/5 23:45
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static Stringprotected static Stringstatic JWTTokenparse(String tokenStr, boolean iss, boolean checkExp, Duration delayExp, Function<String, com.sankcrm.erp.common.sensitive.SecretKey> keySupper) 解析令牌static JWTToken解析令牌sign(com.sankcrm.erp.common.secret.sign.SignAlgorithm algorithm, com.sankcrm.erp.common.sensitive.SecretKey key) toToken()
-
Field Details
-
ZONE_ID
-
-
Constructor Details
-
JWTToken
public JWTToken()
-
-
Method Details
-
sign
public JWTToken sign(com.sankcrm.erp.common.secret.sign.SignAlgorithm algorithm, com.sankcrm.erp.common.sensitive.SecretKey key) -
toToken
-
encode
-
decode
-
parse
public static JWTToken parse(String tokenStr, boolean iss, boolean checkExp, Duration delayExp, Function<String, com.sankcrm.erp.common.sensitive.SecretKey> keySupper) 解析令牌- Parameters:
tokenStr- 令牌iss- true 校验 ISS, false 不校验年 ISScheckExp- true 校验令牌是否过期, 反之不校验 @since 2.5.0delayExp- 延迟过期时间keySupper- 秘钥提供者- Returns:
- 令牌
-
parse
解析令牌- Parameters:
token- 令牌iss- true 校验 ISS, false 不校验 ISS @since 2.1.5delayExp- 延迟过期的时间 @since 2.1.5checkExp- true 校验令牌是否过期, 反之不校验 @since 2.5.0- Returns:
- 令牌
-