1. createCredential

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

    com.webank.weid.protocol.base.WeIdPrivateKey

    名称类型非空说明备注
    privateKeyStringY私钥值使用十进制数字表示

    com.webank.weid.protocol.response.TransactionInfo

    名称类型说明备注
    blockNumberBigInteger交易块高
    transactionHashString交易hash
    transactionIndexBigInteger交易索引

    com.webank.weid.protocol.base.CredentialWrapper

    名称类型非空说明备注
    contextStringY版本默认为v1
    idStringY证书ID
    cptIdIntegerYcptId
    issuerStringYWeIdentity DID
    issuanceDateLongY创建日期
    expirationDateLongY到期日期
    claimMap<String, Object>YClaim数据
    proofMap<String, Object>Y签名数据结构体

    此方法返回code

    调用示例

    sequenceDiagramparticipant 调用者participant CredentialService调用者->>CredentialService: 调用CreateCredential()CredentialService->>CredentialService: 入参非空、格式及合法性检查opt 入参校验失败CredentialService—>>调用者: 报错,提示参数不合法并退出endCredentialService->>CredentialService: 生成签发日期、生成数字签名CredentialService—>>调用者: 返回凭证