4. getWeIDDocment

基本信息

  1. 接口名称:com.webank.weid.rpc.WeIdService.getWeIdDocument
  2. 接口定义:ResponseData<WeIdDocument> getWeIdDocument(String weId)
  3. 接口描述: 根据WeIdentity DID查询出WeIdentity DID Document对象。

接口入参: String

名称类型非空说明备注
weIdStringYWeIdentity DID字符串

接口返回: com.webank.weid.protocol.response.ResponseData<WeIdDocument>;

名称类型说明备注
errorCodeInteger返回结果码
errorMessageString返回结果描述
resultWeIdDocument 见下
transactionInfoTransactionInfo交易信息

com.webank.weid.protocol.response.TransactionInfo

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

com.webank.weid.protocol.base.WeIdDocument

名称类型说明备注
idStringWeIdentity DID
createdLong创建时间
updatedLong更新时间
publicKeyList 列出公钥集合,见下
authenticationList 认证方集合,见下
serviceList 服务端点集合,见下

com.webank.weid.protocol.base.PublicKeyProperty

名称类型说明备注
idString
typeString类型默认为:Secp256k1
ownerString拥有者WeIdentity DID
publicKeyString数字公钥

com.webank.weid.protocol.base.AuthenticationProperty

名称类型说明备注
typeString类型默认为:Secp256k1
publicKeyString

com.webank.weid.protocol.base.ServiceProperty

名称类型说明备注
typeString类型
serviceEndpointString

此方法返回code

enumcodedesc
SUCCESS0成功
WEID_INVALID100101无效的WeIdentity DID
WEID_DOES_NOT_EXIST100104WeIdentity DID不存在
TRANSACTION_TIMEOUT160001超时
TRANSACTION_EXECUTE_ERROR160002交易错误
UNKNOW_ERROR160003其他错误

调用示例

  1. WeIdService weIdService = new WeIdServiceImpl();
  2. ResponseData<WeIdDocument> response = weIdService.getWeIdDocument("did:weid:101:0xd9aeaa982fc21ea9addaf09e4f0c6a23a08d306a");
  1. 返回结果如下:
  2. result:(com.webank.weid.protocol.base.WeIdDocument)
  3. id: did:weid:101:0xd9aeaa982fc21ea9addaf09e4f0c6a23a08d306a
  4. created: 1560419409898
  5. updated: 1560419409898
  6. publicKey:(java.util.ArrayList)
  7. [0]:com.webank.weid.protocol.base.PublicKeyProperty
  8. id: did:weid:101:0xd9aeaa982fc21ea9addaf09e4f0c6a23a08d306a#keys-0
  9. type: Secp256k18
  10. owner: did:weid:101:0xd9aeaa982fc21ea9addaf09e4f0c6a23a08d306a
  11. publicKey: 2905679808560626772263712571437125497429146398815877180317365034921958007199576809718056336050058032599743534507469742764670961100255274766148096681073592
  12. authentication:(java.util.ArrayList)
  13. [0]:com.webank.weid.protocol.base.AuthenticationProperty
  14. type: Secp256k1
  15. publicKey: did:weid:101:0xd9aeaa982fc21ea9addaf09e4f0c6a23a08d306a#keys-0
  16. service:(java.util.ArrayList)
  17. [0]:com.webank.weid.protocol.base.ServiceProperty
  18. type: drivingCardService
  19. serviceEndpoint: https://weidentity.webank.com/endpoint/8377464
  20. errorCode: 0
  21. errorMessage: success
  22. transactionInfo:null