1. registerCpt
接口入参: com.webank.weid.protocol.request.CptMapArgs
com.webank.weid.protocol.base.WeIdAuthentication
名称 | 类型 | 非空 | 说明 | 备注 |
---|---|---|---|---|
weId | String | Y | CPT发布者的WeIdentity DID | WeIdentity DID的格式传入 |
weIdPublicKeyId | String | N | 公钥Id | |
weIdPrivateKey | WeIdPrivateKey | Y | 交易私钥,见下 |
com.webank.weid.protocol.base.WeIdPrivateKey
名称 | 类型 | 说明 | 备注 |
---|---|---|---|
errorCode | Integer | 返回结果码 | 此接口返回的code |
errorMessage | String | 返回结果描述 | |
result | CptBaseInfo | CPT基础数据,见下 | |
transactionInfo | TransactionInfo | 交易信息 |
com.webank.weid.protocol.response.TransactionInfo
com.webank.weid.protocol.base.CptBaseInfo
名称 | 类型 | 说明 | 备注 |
---|---|---|---|
cptId | Integer | cpId编号 | |
cptVersion | Integer | 版本号 |
此方法返回code
时序图
(同时也包含重载updateCpt时序)
sequenceDiagram调用者->>WeIdentity SDK : 传入自己已有的WeIdentity DID及对应的私钥,及其jsonSchema,调用registerCpt来注册CPT。opt 参数校验Note over WeIdentity SDK:如果WeIdentity DID或者私钥为空或不匹配WeIdentity SDK->>WeIdentity SDK:报错,提示参数不合法并退出endWeIdentity SDK->>区块链节点: 将java对象转换为合约所需的字段,调用智能合约,将CPT信息上链opt 身份校验Note over 区块链节点:如果传入WeIdentity DID在链上不存在区块链节点->>区块链节点:报错,提示WeIdentity DID不存在并退出end区块链节点->>区块链节点:写入CPT信息区块链节点—>>WeIdentity SDK:返回WeIdentity SDK—>>调用者:返回调用结果