1. createCredential
接口入参: com.webank.weid.protocol.request.CreateCredentialArgs
com.webank.weid.protocol.base.WeIdPrivateKey
名称 | 类型 | 非空 | 说明 | 备注 |
---|---|---|---|---|
privateKey | String | Y | 私钥值 | 使用十进制数字表示 |
com.webank.weid.protocol.response.TransactionInfo
名称 | 类型 | 说明 | 备注 |
---|---|---|---|
blockNumber | BigInteger | 交易块高 | |
transactionHash | String | 交易hash | |
transactionIndex | BigInteger | 交易索引 |
com.webank.weid.protocol.base.CredentialWrapper
名称 | 类型 | 非空 | 说明 | 备注 |
---|---|---|---|---|
context | String | Y | 版本 | 默认为v1 |
id | String | Y | 证书ID | |
cptId | Integer | Y | cptId | |
issuer | String | Y | WeIdentity DID | |
issuanceDate | Long | Y | 创建日期 | |
expirationDate | Long | Y | 到期日期 | |
claim | Map<String, Object> | Y | Claim数据 | |
proof | Map<String, Object> | Y | 签名数据结构体 |
此方法返回code
调用示例
sequenceDiagramparticipant 调用者participant CredentialService调用者->>CredentialService: 调用CreateCredential()CredentialService->>CredentialService: 入参非空、格式及合法性检查opt 入参校验失败CredentialService—>>调用者: 报错,提示参数不合法并退出endCredentialService->>CredentialService: 生成签发日期、生成数字签名CredentialService—>>调用者: 返回凭证