public final class NacosSignatureAlgorithm extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static NacosSignatureAlgorithm |
HS256 |
static NacosSignatureAlgorithm |
HS384 |
static NacosSignatureAlgorithm |
HS512 |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getAlgorithm() |
static long |
getExpiredTimeInSeconds(String jwt,
Key key)
get jwt expire time in seconds.
|
long |
getExpireTimeInSeconds(String header,
String payload,
String signature,
Key key)
get jwt expire time in seconds.
|
String |
getHeader() |
String |
getJcaName() |
static NacosUser |
verify(String jwt,
Key key)
verify jwt.
|
NacosUser |
verify(String header,
String payload,
String signature,
Key key)
verify jwt.
|
public static final NacosSignatureAlgorithm HS256
public static final NacosSignatureAlgorithm HS384
public static final NacosSignatureAlgorithm HS512
public static NacosUser verify(String jwt, Key key) throws AccessException
jwt - complete jwt stringkey - for signatureAccessException - access exceptionpublic NacosUser verify(String header, String payload, String signature, Key key) throws AccessException
header - header of jwtpayload - payload of jwtsignature - signature of jwtkey - for signatureAccessException - access exceptionpublic static long getExpiredTimeInSeconds(String jwt, Key key) throws AccessException
jwt - complete jwt stringkey - for signatureAccessException - access exceptionpublic long getExpireTimeInSeconds(String header, String payload, String signature, Key key) throws AccessException
header - header of jwtpayload - payload of jwtsignature - signature of jwtkey - for signatureAccessException - access exceptionpublic String getAlgorithm()
public String getJcaName()
public String getHeader()
Copyright © 2018–2023 Alibaba Group. All rights reserved.