public class AsymmetricJWTSigner extends Object implements JWTSigner
Constructor and Description |
---|
AsymmetricJWTSigner(String algorithm,
Key key)
构造
|
AsymmetricJWTSigner(String algorithm,
KeyPair keyPair)
构造
|
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm()
获取算法
|
AsymmetricJWTSigner |
setCharset(Charset charset)
设置编码
|
protected byte[] |
sign(byte[] data)
签名字符串数据
|
String |
sign(String headerBase64,
String payloadBase64)
签名
|
protected boolean |
verify(byte[] data,
byte[] signed)
验签数据
|
boolean |
verify(String headerBase64,
String payloadBase64,
String signBase64)
验签
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAlgorithmId
public AsymmetricJWTSigner(String algorithm, Key key)
algorithm
- 算法字符串表示key
- 公钥PublicKey
或私钥PrivateKey
,公钥用于验证签名,私钥用于产生签名public AsymmetricJWTSigner setCharset(Charset charset)
charset
- 编码public String sign(String headerBase64, String payloadBase64)
JWTSigner
protected byte[] sign(byte[] data)
data
- 数据public boolean verify(String headerBase64, String payloadBase64, String signBase64)
JWTSigner
protected boolean verify(byte[] data, byte[] signed)
data
- 数据signed
- 签名public String getAlgorithm()
JWTSigner
getAlgorithm
in interface JWTSigner
Copyright © 2024. All rights reserved.