1. registerCpt

    接口入参: com.webank.weid.protocol.request.CptMapArgs

    com.webank.weid.protocol.base.WeIdAuthentication

    名称类型非空说明备注
    weIdStringYCPT发布者的WeIdentity DIDWeIdentity DID的格式传入
    weIdPublicKeyIdStringN公钥Id
    weIdPrivateKeyWeIdPrivateKeyY 交易私钥,见下

    com.webank.weid.protocol.base.WeIdPrivateKey

    名称类型说明备注
    errorCodeInteger返回结果码此接口返回的code
    errorMessageString返回结果描述
    resultCptBaseInfo CPT基础数据,见下
    transactionInfoTransactionInfo交易信息

    com.webank.weid.protocol.response.TransactionInfo

    com.webank.weid.protocol.base.CptBaseInfo

    名称类型说明备注
    cptIdIntegercpId编号
    cptVersionInteger版本号

    此方法返回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—>>调用者:返回调用结果