T - public class ServicesRequestEntity<T> extends Object implements ServicesRequest<T>
| 限定符和类型 | 类和说明 |
|---|---|
static interface |
ServicesRequestEntity.CryptoBuilder<B extends ServicesRequestEntity.CryptoBuilder<B>>
安全算法相关
|
static class |
ServicesRequestEntity.DefaultBuilder |
static interface |
ServicesRequestEntity.ParamsBuilder
构造参数
|
| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
accessKey
请求服务接口账号
Access Key : key
Access Key Secret : 秘钥
|
protected String |
cipherData
Json -> (body);
加密传输
|
protected String |
cipherKey
加密用的key
1、随机生成(sm4/ Aes-128)
|
protected String |
clientTraceId
每一个请求ID
|
protected T |
data |
protected String |
dataAlg
数据加密算法
AES / SM4
|
protected String |
keyAlg
非对称秘钥版本号
rsa : 用于cipher - key加密
|
protected String |
keyVersion |
protected String |
sign
RsaWithSha256(access_key + clientTraceId + timestamp + jsonData + access_secret)
SHA256withRSA
| - 私钥签名
| - 公钥签名
|
protected long |
timestamp
精确到毫秒 [时间戳 2分钟内有效]
1970+
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
ServicesRequestEntity() |
|
ServicesRequestEntity(String keyAlg,
String keyVersion,
String alg,
String cipherKey,
String clientTraceId,
String accessKey,
long timestamp,
String sign,
String cipherData,
T dataObj) |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getAccessKey()
客户接口访问账号
参数类型 : Varchar
参数长度 : 100
|
String |
getCipherData() |
String |
getCipherKey()
经过rsa加密后的秘钥
|
String |
getClientTraceId()
客户定义唯一id
参数类型 : Varchar
参数长度 : 12 ~ 100
|
T |
getData() |
String |
getDataAlg() |
String |
getKeyAlg() |
String |
getKeyVersion() |
String |
getSign() |
long |
getTimestamp() |
ServicesRequestEntity<T> |
nullPlainData()
只传输加密数据,原始数据不传递
|
static ServicesRequestEntity.DefaultBuilder |
secure() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetServiceCodeprotected String clientTraceId
protected String accessKey
protected String keyAlg
protected String keyVersion
protected String cipherKey
protected String dataAlg
protected long timestamp
protected String sign
protected String cipherData
protected T data
protected ServicesRequestEntity()
public ServicesRequestEntity(String keyAlg, String keyVersion, String alg, String cipherKey, String clientTraceId, String accessKey, long timestamp, String sign, String cipherData, T dataObj)
keyAlg - : 非对称秘钥加密算法 (rsa / sm2)keyVersion - : 秘钥版本号alg - : 数据加密算法 (Aes/sm4)cipherKey - : 经过 rsa/sm2 加密后的数据sign - :签名 (access_key + clientTraceId + timestamp + jsonData + access_secret)clientTraceId - :流水号accessKey - : 访问秘钥timestamp - : 毫秒时间戳cipherData - : 加密 -> json(obj)dataObj - public static ServicesRequestEntity.DefaultBuilder secure()
public ServicesRequestEntity<T> nullPlainData()
public String getClientTraceId()
ServicesRequestgetClientTraceId 在接口中 ServicesRequest<T>public String getAccessKey()
ServicesRequestgetAccessKey 在接口中 ServicesRequest<T>public String getKeyAlg()
getKeyAlg 在接口中 ServicesRequest<T>public String getKeyVersion()
getKeyVersion 在接口中 ServicesRequest<T>public String getCipherKey()
ServicesRequestgetCipherKey 在接口中 ServicesRequest<T>public String getDataAlg()
getDataAlg 在接口中 ServicesRequest<T>public long getTimestamp()
getTimestamp 在接口中 ServicesRequest<T>public String getSign()
getSign 在接口中 ServicesRequest<T>public String getCipherData()
getCipherData 在接口中 ServicesRequest<T>public T getData()
getData 在接口中 ServicesRequest<T>Copyright © 2023 Pivotal Software, Inc.. All rights reserved.