类 DidClient
java.lang.Object
DidClient
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明documentGet
(String did) 查询DID文档int
getHost()
int
health()
健康检查登录msgDecrypt
(Cipher cipher) 使用私钥解密msgEncrypt
(Plaintext plaintext) 使用公钥加密did私钥签名公钥验签void
setConnectTimeOut
(int connectTimeOut) void
void
setReadTimeOut
(int readTimeOut) 根据id查询vc颁发凭证用户查询自身vcvcListIssued
(Holder holder) 查询已颁发vcvcListLatest
(String issuer, Integer limit) 更新拥有的VC列表vcListLocal
(VcListVo vo) 本地查询拥有VCvcListRevoked
(Holder holder) 查询已吊销vc吊销VCvctemplateCreate
(VCTExtend vctExtend) 申请vctvctemplateList
(VcTemplateListVo vcTemplateListVo) 查询vct生成请求企业实名VP生成请求登录VP<T,
U> T vpSign
(VerifiablePresentation vp, Class<U> u) 签名vp验证vp验证vp
-
构造器详细资料
-
DidClient
public DidClient() -
DidClient
-
DidClient
-
-
方法详细资料
-
getHost
-
setHost
-
getReadTimeOut
public int getReadTimeOut() -
setReadTimeOut
public void setReadTimeOut(int readTimeOut) -
getConnectTimeOut
public int getConnectTimeOut() -
setConnectTimeOut
public void setConnectTimeOut(int connectTimeOut) -
login
登录- 参数:
username
- 用户名称password
- 用户密码- 返回:
AccessToken
data- 抛出:
ChainWeaverException
- 访问异常
-
health
健康检查- 返回:
DidHealth
包含版本号和系统名称- 抛出:
ChainWeaverException
- 访问异常
-
msgEncrypt
使用公钥加密- 参数:
plaintext
-Plaintext(String plaintext, String verificationMethod)
- plaintext签名原文
- verificationMethod 公钥地址, 默认使用DID第一个公钥
- type 可以不进行设置, 默认为SM2ASN1
- 返回:
Cipher
加密签名- 抛出:
ChainWeaverException
- 访问异常
-
msgDecrypt
使用私钥解密- 参数:
cipher
-Cipher(String ciphertext)
ciphertext 密文值- verificationMethod 公钥地址,默认使用DID第一个公钥
- type 可以不进行设置, 默认为SM2ASN1
- 返回:
Plaintext
返回原文- 抛出:
ChainWeaverException
- 访问异常
-
msgVerify
公钥验签- 参数:
plaintext
-Plaintext
签名对象- 返回:
- 验签是否正常
- 抛出:
ChainWeaverException
- 访问异常
-
msgSign
did私钥签名- 参数:
plaintext
-Plaintext(String plaintext, String verificationMethod)
- plaintext 签名原文
- verificationMethod 公钥地址
- 返回:
- 返回签名值
- 抛出:
ChainWeaverException
- 访问异常
-
vpVerify
验证vp- 参数:
vp
-VerifiablePresentation
- 返回:
- 验证是否成功
- 抛出:
ChainWeaverException
- 访问异常
-
vpVerify
验证vp- 参数:
vp
- vp格式的字符串- 返回:
- 验证是否成功
- 抛出:
ChainWeaverException
- 访问异常
-
vpSign
签名vp- 参数:
vp
- {@link VerifiablePresentation# VerifiablePresentation(List context, String id, List verifiableCredential, String presentationUsage, String expirationDate, String verifier, List proof)}- context 上下文; 可选
- id 唯一编号; 可选
- verifiableCredential vcId列表,可验证凭据, 与extend至少有一个不为空; 可选
- extend 自定义参数; 可选
- presentationUsage 用途;可选
- expirationDate 过期时间;可选
- verifier 验证人;可选
- proof 证明结构
Proof(String type, String created, String proofPurpose, String verificationMethod)
- type 签名算法; 可选 ,default: SM2Signature
- created 签名时间; 可选
- proofPurpose 签名目的; 可选 .固定:authentication
- verificationMethod 签名公钥
- 返回:
- vp相关信息
- 抛出:
ChainWeaverException
- 访问异常
-
documentGet
查询DID文档- 参数:
did
- did名称- 返回:
- Document
- 抛出:
ChainWeaverException
- 访问异常
-
vcIssue
颁发凭证- 参数:
issueVc
-IssueVc(String templateId, CredentialSubject credentialSubject, String holder, String verificationMethod)
对象- 返回:
- Response
- 抛出:
ChainWeaverException
- 访问异常
-
vcRevoke
吊销VC- 参数:
id
- 凭证id- 返回:
- 吊销是否成功
- 抛出:
ChainWeaverException
- 访问异常
-
vcListIssued
public Response<RespPage<VerifiableCredential>> vcListIssued(Holder holder) throws ChainWeaverException 查询已颁发vc- 参数:
holder
-Holder(String, Integer, Integer)
持有人对象, 页数, 条数- 返回:
- vc 列表
- 抛出:
ChainWeaverException
- 访问异常
-
vcListRevoked
public Response<RespPage<VerifiableCredential>> vcListRevoked(Holder holder) throws ChainWeaverException 查询已吊销vc- 参数:
holder
-Holder(String, Integer, Integer)
持有人对象, 页数, 条数- 返回:
- 吊销vc列表
- 抛出:
ChainWeaverException
- 访问异常
-
vcList
public Response<RespPage<VerifiableCredential>> vcList(VerifiablePresentation vp) throws ChainWeaverException 用户查询自身vc- 参数:
vp
-VerifiablePresentation(List verifiableCredential, List proof)
- context 上下文; 可选
- id 唯一编号; 可选
- verifiableCredential vcId列表,可验证凭据, 与extend至少有一个不为空; 可选
- extend 自定义参数; 可选
- page: 分页结构
Page
- issuer: 签发者
- templateId:模板ID;可选
- status: 状态;可选
- presentationUsage 用途;可选
- expirationDate 过期时间;可选
- verifier 验证人;可选
- proof 证明结构
Proof(String type, String created, String proofPurpose, String verificationMethod)
- type 签名算法; 可选 ,default: SM2Signature
- created 签名时间; 可选
- proofPurpose 签名目的; 可选 .固定:authentication
- verificationMethod 签名公钥
- 返回:
- vc列表
- 抛出:
ChainWeaverException
- 访问异常
-
vcGet
根据id查询vc- 参数:
vcId
- vcId- 返回:
- vc详情
- 抛出:
ChainWeaverException
- 访问异常
-
vcListLatest
更新拥有的VC列表- 参数:
issuer
- 持证人limit
- 限制条数- 返回:
- 返回本地vc列表
- 抛出:
ChainWeaverException
- 访问异常
-
vcListLocal
public Response<RespPage<VerifiableCredential>> vcListLocal(VcListVo vo) throws ChainWeaverException 本地查询拥有VC- 参数:
vo
-VcListVo
发证人和vcId- 返回:
- 返回本地vc列表
- 抛出:
ChainWeaverException
- 访问异常
-
vctemplateCreate
申请vct- 参数:
vctExtend
-VCTExtend(Map properties, List required, String name, String versions, Boolean additionalProperties, String verificationMethod)
- extend 自定义参数; 可选
- vcType: 类型;可选 ,default: IdentityCredential
- properties: 自定义字段 Map<String, property>
Property(String type, String title, String reg, String desc)
- type: 字段类型
- title: 字段的中文名
- reg: 正则表达式
- desc: 描述
- required:是否必填; List
key字段是否必填 - name: 凭证类型
- versions: 版本号
- additionalProperties; Boolean 是否允许VC的credentialSubject添加额外字段
- 返回:
- vct id
- 抛出:
ChainWeaverException
- 访问异常
-
vctemplateList
public Response<RespPage<VcTInfo>> vctemplateList(VcTemplateListVo vcTemplateListVo) throws ChainWeaverException 查询vct- 参数:
vcTemplateListVo
-VcTemplateListVo(Integer page, Integer size, String id, String name, String version)
- page-页数
- size-条数.
- id-vcId.
- name-名称.
- version- 版本号.
- 返回:
- 返回vct列表
- 抛出:
ChainWeaverException
- 访问异常
-
vpCreateApplyLogin
public Response<VerifiablePresentation> vpCreateApplyLogin(VerifiablePresentation vp) throws ChainWeaverException 生成请求登录VP- 参数:
vp
-VerifiablePresentation.vpCreateApplyLogin(List proof)
- context 上下文, 可选
- id 唯一编号; 可选
- verifiableCredential vcId列表,可验证凭据, 与extend至少有一个不为空; 可选
- extend 自定义参数; 可选
- presentationUsage 用途;可选
- expirationDate 过期时间;可选
- verifier 验证人;可选
- proof 证明结构
Proof(String type, String created, String proofPurpose, String verificationMethod)
- type 签名算法; 可选 ,default: SM2Signature
- created 签名时间; 可选
- proofPurpose 签名目的; 可选 .固定:authentication
- verificationMethod 签名公钥
- 返回:
- Response
- 抛出:
ChainWeaverException
- 访问异常
-
vpCreateApplyBusinessLicense
public Response<VerifiablePresentation<ApplyBusinessLicenseExtend>> vpCreateApplyBusinessLicense(VerifiablePresentation vp) throws ChainWeaverException 生成请求企业实名VP- 参数:
vp
-VerifiablePresentation.vpCreateApplyBusinessLicense(List proof)
- context 上下文, 可选
- id 唯一编号; 可选
- verifiableCredential vcId列表,可验证凭据, 与extend至少有一个不为空; 可选
- extend 自定义参数; 可选 ApplyBusinessLicenseExtend
ApplyBusinessLicenseExtend(String issuer, String callbackUrl)
- callbackUrl: 回调地址; 必选
- issuer:发证机构; 可选
- requestId: 请求id; 必选,如果不传,会默认生成一个
- vctId: 模版id; 可选
- presentationUsage 用途;必选
- expirationDate 过期时间;可选
- verifier 验证人;可选
- proof 证明结构
Proof(String type, String created, String proofPurpose, String verificationMethod)
- type 签名算法; 可选 ,default: SM2Signature
- created 签名时间; 可选
- proofPurpose 签名目的; 可选 .固定:authentication
- verificationMethod 签名公钥
- 返回:
- Response
- 抛出:
ChainWeaverException
- 访问异常
-