tccli 3.0.1042.1__py2.py3-none-any.whl → 3.0.1043.1__py2.py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- tccli/__init__.py +1 -1
- tccli/examples/tdid/v20210519/CheckNewPurchase.md +18 -0
- tccli/examples/tdid/v20210519/CreateTDidByHost.md +25 -0
- tccli/examples/tdid/v20210519/CreateTDidByPubKey.md +28 -0
- tccli/examples/tdid/v20210519/DeactivateTDid.md +52 -0
- tccli/examples/tdid/v20210519/GetCredentialState.md +33 -0
- tccli/examples/tdid/v20210519/GetTDidDocument.md +22 -0
- tccli/examples/tdid/v20210519/IssueCredential.md +25 -0
- tccli/examples/tdid/v20210519/UpdateCredentialState.md +57 -0
- tccli/examples/tdid/v20210519/VerifyCredentials.md +24 -0
- tccli/services/tdid/tdid_client.py +36 -248
- tccli/services/tdid/v20210519/api.json +346 -712
- tccli/services/tdid/v20210519/examples.json +44 -76
- {tccli-3.0.1042.1.dist-info → tccli-3.0.1043.1.dist-info}/METADATA +2 -2
- {tccli-3.0.1042.1.dist-info → tccli-3.0.1043.1.dist-info}/RECORD +18 -9
- {tccli-3.0.1042.1.dist-info → tccli-3.0.1043.1.dist-info}/WHEEL +0 -0
- {tccli-3.0.1042.1.dist-info → tccli-3.0.1043.1.dist-info}/entry_points.txt +0 -0
- {tccli-3.0.1042.1.dist-info → tccli-3.0.1043.1.dist-info}/license_files/LICENSE +0 -0
tccli/__init__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '3.0.
|
1
|
+
__version__ = '3.0.1043.1'
|
@@ -0,0 +1,25 @@
|
|
1
|
+
**Example 1: 自动生成公私钥注册DID**
|
2
|
+
|
3
|
+
TDID平台自动生成公私钥对托管在DID平台,并注册DID
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli tdid CreateTDidByHost --cli-unfold-argument \
|
9
|
+
--DAPId 1 \
|
10
|
+
--CustomAttribute {"a":{"c":1},"b":"test"}
|
11
|
+
```
|
12
|
+
|
13
|
+
Output:
|
14
|
+
```
|
15
|
+
{
|
16
|
+
"Response": {
|
17
|
+
"RequestId": "fac6ef5a-7637-4a75-a2d3-0f7d87b5b8b5",
|
18
|
+
"Did": "did:tdid:w1:0xdab41eb32082044366f1b5712504d0b623b095c1",
|
19
|
+
"Transaction": {
|
20
|
+
"TransactionHash": "1747ae57db16f1d6cac4b711742904f87030f3eee8704439aa203a8278d219c3"
|
21
|
+
}
|
22
|
+
}
|
23
|
+
}
|
24
|
+
```
|
25
|
+
|
@@ -0,0 +1,28 @@
|
|
1
|
+
**Example 1: 导入公钥注册DID标识**
|
2
|
+
|
3
|
+
上传用户本地公钥文件创建DID标识
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli tdid CreateTDidByPubKey --cli-unfold-argument \
|
9
|
+
--DAPId 1 \
|
10
|
+
--PublicKey -----BEGIN PUBLIC KEY-----
|
11
|
+
MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAEaI9IwGTO3SL6tamGNdyFi+zg8W7W
|
12
|
+
53dKNBC3xuRXdlbor0gTIlYSgKIyClY6KUrizmW6gMfKcrzBojml5j4JJg==
|
13
|
+
-----END PUBLIC KEY-----
|
14
|
+
```
|
15
|
+
|
16
|
+
Output:
|
17
|
+
```
|
18
|
+
{
|
19
|
+
"Response": {
|
20
|
+
"RequestId": "fac6ef5a-7637-4a75-a2d3-0f7d87b5b8b5",
|
21
|
+
"Did": "did:tdid:w1:0xdab41eb32082044366f1b5712504d0b623b095c1",
|
22
|
+
"Transaction": {
|
23
|
+
"TransactionHash": "1747ae57db16f1d6cac4b711742904f87030f3eee8704439aa203a8278d219c3"
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
```
|
28
|
+
|
@@ -0,0 +1,52 @@
|
|
1
|
+
**Example 1: 更新DID标识的禁用状态**
|
2
|
+
|
3
|
+
更新DID标识的禁用状态
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli tdid DeactivateTDid --cli-unfold-argument \
|
9
|
+
--Did did:tdid:w1:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb \
|
10
|
+
--OperateCredential {
|
11
|
+
"cptId": 1,
|
12
|
+
"issuer": "did:tdid:w1:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb",
|
13
|
+
"expirationDate": "2023-12-01T10:00:00+08:00",
|
14
|
+
"issuanceDate": "2023-09-19T19:50:52+08:00",
|
15
|
+
"context": "https://github.com/TencentCloud-Blockchain/TDID/blob/main/context/v1",
|
16
|
+
"id": "250d0563e9d680c4d2c33b428913442f",
|
17
|
+
"type": ["VerifiableCredential"],
|
18
|
+
"credentialSubject": {
|
19
|
+
"action": "deactiveDid",
|
20
|
+
"deactivated": "true",
|
21
|
+
"did": "did:tdid:w1:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb"
|
22
|
+
},
|
23
|
+
"proof": {
|
24
|
+
"created": "2023-09-19T19:50:52+08:00",
|
25
|
+
"creator": "did:tdid:c5:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb#keys-0",
|
26
|
+
"signatureValue": "MEYCIQDSQFpHNt7xltx+dPhwHDrY3kJpMG+hE7Klh/c11Ce3WQIhAOFaISj1kvk8TjrlMaoTAAhoAiriBFj0lLwWyNp69kW7",
|
27
|
+
"type": "Secp256r1",
|
28
|
+
"metaDigest": "9b916ba1e4435f752052fbafe3ed270b61f729feade30fec20aeef4dbac16712",
|
29
|
+
"vcDigest": "692c38a285093f538821f7cce3ddc8358f10f219e991faf226356043228eda24",
|
30
|
+
"privacy": "Public",
|
31
|
+
"salt": {
|
32
|
+
"action": "CTtap",
|
33
|
+
"deactivated": "1jfRX",
|
34
|
+
"did": "D8ukJ"
|
35
|
+
}
|
36
|
+
}
|
37
|
+
} \
|
38
|
+
--DAPId 5
|
39
|
+
```
|
40
|
+
|
41
|
+
Output:
|
42
|
+
```
|
43
|
+
{
|
44
|
+
"Response": {
|
45
|
+
"Transaction": {
|
46
|
+
"TransactionHash": "17a6bfc02e84d8afca728a0285e5cfc20812a7ca5e0244188a1fdb12cf402789"
|
47
|
+
},
|
48
|
+
"RequestId": "018647ac-f5ef-478e-bc7c-1e72ae4afac1"
|
49
|
+
}
|
50
|
+
}
|
51
|
+
```
|
52
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
**Example 1: 获取凭证链上状态信息**
|
2
|
+
|
3
|
+
获取凭证链上状态信息
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli tdid GetCredentialState --cli-unfold-argument \
|
9
|
+
--CredentialId 8818fdd61eb84e4a745a3b04c96e5237 \
|
10
|
+
--DAPId 5
|
11
|
+
```
|
12
|
+
|
13
|
+
Output:
|
14
|
+
```
|
15
|
+
{
|
16
|
+
"Response": {
|
17
|
+
"RequestId": "10f21d53-43f7-4736-a028-384b446132d0",
|
18
|
+
"CredentialState": {
|
19
|
+
"Id": "8818fdd61eb84e4a745a3b04c96e5237",
|
20
|
+
"Status": 1,
|
21
|
+
"CPTId": 1,
|
22
|
+
"Issuer": "did:tdid:c5:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb",
|
23
|
+
"TXDigest": "",
|
24
|
+
"VCDigest": "c7e13c5bcfa879c922f9141d085facc0ce1973e8d27d48238130739c1a332dcf",
|
25
|
+
"MetaDigest": "6a216f84cb9c5b6170cb017cccd6c5d0b81aad200d5691914d6045471d0dd1ad",
|
26
|
+
"IssueTime": 1695125060,
|
27
|
+
"ExpireTime": 1701396000,
|
28
|
+
"Signature": "MEUCIQDUneIwlLbh5AFjQt9HJhIZAQshT45/Em8hVOUjHcdu0QIgL3rg3A99qGGNszstF+GTV5IU4vT9OnI1lqM3f0c5JmI="
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
```
|
33
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
**Example 1: 获取DID标识的文档**
|
2
|
+
|
3
|
+
无
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli tdid GetTDidDocument --cli-unfold-argument \
|
9
|
+
--DAPId 1 \
|
10
|
+
--Did did:tdid:w1:0x05cdde231b90dbcb1e0a9e7a616bf17c7168c2ac
|
11
|
+
```
|
12
|
+
|
13
|
+
Output:
|
14
|
+
```
|
15
|
+
{
|
16
|
+
"Response": {
|
17
|
+
"Document": "{\n \"@context\" : \"https://github.com/TencentCloud-Blockchain/TDID/blob/main/context/v1\",\n \"symbol\" : \"BAYC\",\n \"creator\" : \"did:tdid:w1:0x1a8ca5daffe98e48483fa58d7b352998c34705ca\",\n \"controller\" : \"did:tdid:w1:0x6206a748ad9d3bc35fdbe6ac5248791ae9bb8d45\",\n \"created\" : \"2022-08-08T03:23:40+0000\",\n \"contract\" : \"BAYC1659929019\",\n \"totalCount\" : 1,\n \"deactivated\" : false,\n \"versionId\" : 1,\n \"baseUrl\" : \"https://ipfs.io/ipfs/QmeSjSinHpPnmXmspMjwiXyN6zS4E9zccariGR3jxcaWtq\",\n \"service\" : [ ],\n \"portalUrl\" : \"\",\n \"name\" : \"BoredApeYachtClub\",\n \"id\" : \"did:tdid:cm775g1:0x6206a748ad9d3bc35fdbe6ac5248791ae9bb8d45\",\n \"verificationMethod\" : [ {\n \"controller\" : \"did:tdid:cm775g1:0x6206a748ad9d3bc35fdbe6ac5248791ae9bb8d45\",\n \"id\" : \"did:tdid:cm775g1:0x6206a748ad9d3bc35fdbe6ac5248791ae9bb8d45#keys-0\",\n \"publicKey\" : \"-----BEGIN PUBLIC KEY-----\\r\\nMFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE8AxGIIZS5gNWEBmoAOsHxPd/8D2DrKqMuiWG2cVvYDt6H0CjWixP/RYeTXyRDjuLXd2tINL5VWKzm1EOlhQE+w==\\r\\n-----END PUBLIC KEY-----\",\n \"type\" : \"Sm2p256v1\",\n \"revoked\" : false\n } ],\n \"updated\" : \"2022-08-08T03:23:40+0000\",\n \"desc\" : \"Bored Ape Yacht Club\",\n \"authentication\" : [ \"#keys-0\" ]\n}",
|
18
|
+
"RequestId": "fac6ef5a-7637-4a75-a2d3-0f7d87b5b8b5"
|
19
|
+
}
|
20
|
+
}
|
21
|
+
```
|
22
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
**Example 1: 颁发可验证凭证**
|
2
|
+
|
3
|
+
凭证颁发方签发可验证凭证
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli tdid IssueCredential --cli-unfold-argument \
|
9
|
+
--DAPId 37 \
|
10
|
+
--CRDLArg.CPTId 1 \
|
11
|
+
--CRDLArg.Issuer did:tdid:w1:0x2e3455523646b1f4ebb40fe0c244bc329eb6fcbc \
|
12
|
+
--CRDLArg.ExpirationDate 2023-06-29 15:25:00 \
|
13
|
+
--CRDLArg.ClaimJson {"action": "deactiveDid","id": "did:tdid:w1:0x2e3455523646b1f4ebb40fe0c244bc329eb6fcbc","deactivated": "true", "__trans__": {"x": "a", "y": 1} }
|
14
|
+
```
|
15
|
+
|
16
|
+
Output:
|
17
|
+
```
|
18
|
+
{
|
19
|
+
"Response": {
|
20
|
+
"RequestId": "41a9acae-cef4-4949-b144-48c65ad5e425",
|
21
|
+
"CredentialData": "{\"CPTId\":1,\"issuer\":\"did:tdid:w1:0x2e3455523646b1f4ebb40fe0c244bc329eb6fcbc\",\"expirationDate\":\"2023-06-29T23:25:00+08:00\",\"issuanceDate\":\"2023-03-10T00:35:40+08:00\",\"context\":\"https://github.com/TencentCloud-Blockchain/TDID/blob/main/context/v1\",\"id\":\"88825f41be9648ddb292744ca6468db7\",\"type\":[\"VerifiableCredential\"],\"credentialSubject\":{\"action\":\"deactiveDid\",\"id\":\"did:tdid:w1:0x2e3455523646b1f4ebb40fe0c244bc329eb6fcbc\"},\"proof\":{\"created\":\"2023-03-10T00:35:40+08:00\",\"creator\":\"did:tdid:w1:0x2e3455523646b1f4ebb40fe0c244bc329eb6fcbc#keys-0\",\"signatureValue\":\"MEUCIQDcngP25ZCDNgZJI4zwyaRcKw2Mk99uvd32RDSjN0gZDAIgLSTslRrTet3Wi/lCgFtF4rmkjq5T8bBD4Cehmu5th1c=\",\"type\":\"Sm2p256v1\",\"txDegist\":\"8db419f0d1412340cfceb2ab28eff3d79615dc4d97ba67e58201a36eebc6e177\",\"vcDegist\":\"337bd77829fabf372eb8584b27bdbb3bb06610d70b2e64a96aff6f8a62116648\",\"method\":\"\",\"salt\":{\"action\":\"oY4YW\",\"id\":\"jxKzd\"}}}"
|
22
|
+
}
|
23
|
+
}
|
24
|
+
```
|
25
|
+
|
@@ -0,0 +1,57 @@
|
|
1
|
+
**Example 1: 更新凭证链上状态**
|
2
|
+
|
3
|
+
更新凭证链上状态
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli tdid UpdateCredentialState --cli-unfold-argument \
|
9
|
+
--DAPId 5 \
|
10
|
+
--OperateCredential {
|
11
|
+
"cptId": 1,
|
12
|
+
"issuer": "did:tdid:w1:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb",
|
13
|
+
"expirationDate": "2023-12-01T10:00:00+08:00",
|
14
|
+
"issuanceDate": "2023-09-19T20:13:36+08:00",
|
15
|
+
"context": "https://github.com/TencentCloud-Blockchain/TDID/blob/main/context/v1",
|
16
|
+
"id": "fw1652844bee8e5ecf1b404242b83f1b",
|
17
|
+
"type": ["VerifiableCredential"],
|
18
|
+
"credentialSubject": {
|
19
|
+
"CredentialStatus": {
|
20
|
+
"id": "8818fdd61eb84e4a745a3b04c96e5237",
|
21
|
+
"issuer": "did:tdid:w1:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb",
|
22
|
+
"status": 1
|
23
|
+
},
|
24
|
+
"action": "updateCredentialState",
|
25
|
+
"orignCredential": "{\"cptId\":1,\"issuer\":\"did:tdid:w1:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb\",\"expirationDate\":\"2023-12-01T10:00:00+08:00\",\"issuanceDate\":\"2023-09-19T20:04:20+08:00\",\"context\":\"https://github.com/TencentCloud-Blockchain/TDID/blob/main/context/v1\",\"id\":\"8818fdd61eb84e4a745a3b04c96e5237\",\"type\":[\"VerifiableCredential\"],\"credentialSubject\":{\"action\":\"updateCredentialState\"},\"proof\":{\"created\":\"2023-09-19T20:04:20+08:00\",\"creator\":\"did:tdid:w1:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb#keys-0\",\"signatureValue\":\"MEUCIQDUneIwlLbh5AFjQt9HJhIZAQshT45/Em8hVOUjHcdu0QIgL3rg3A99qGGNszstF+GTV5IU4vT9OnI1lqM3f0w1JmI=\",\"type\":\"Secp256r1\",\"metaDigest\":\"6a216f84cb9w1b6170cb017cccd6w1d0b81aad200d5691914d6045471d0dd1ad\",\"vcDigest\":\"c7e13w1bcfa879c922f9141d085facc0ce1973e8d27d48238130739c1a332dcf\",\"privacy\":\"Public\",\"salt\":{\"action\":\"HZdDU\"}}}"
|
26
|
+
},
|
27
|
+
"proof": {
|
28
|
+
"created": "2023-09-19T20:13:36+08:00",
|
29
|
+
"creator": "did:tdid:w1:0xe0fd109747937fbaf68ef1f615c2cd8e87d22ffb#keys-0",
|
30
|
+
"signatureValue": "MEUCIDkLg6EqmwvEHYLtjumpeqKz/hIi6EROMDXPPpNIxORHAiEA8T0LMI59tkBTz+llu/GkjToj5M8k5SwXFoU3fnjQ3mo=",
|
31
|
+
"type": "Secp256r1",
|
32
|
+
"metaDigest": "46894b7f54365d685ba587608d2b74f800404ebb76f5c32dd90bc3916e844ae2",
|
33
|
+
"vcDigest": "d086ba831ab3185971c168w125bf2bd487d7eced3ede8d623b30cfe9da03bcaf",
|
34
|
+
"privacy": "Public",
|
35
|
+
"salt": {
|
36
|
+
"CredentialStatus": {
|
37
|
+
"id": "4dPOH",
|
38
|
+
"issuer": "OJH5M",
|
39
|
+
"status": "lm2W4"
|
40
|
+
},
|
41
|
+
"action": "r95wA",
|
42
|
+
"orignCredential": "b3H4j"
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
```
|
47
|
+
|
48
|
+
Output:
|
49
|
+
```
|
50
|
+
{
|
51
|
+
"Response": {
|
52
|
+
"RequestId": "f5e12d37-100a-4b82-b522-7b76c519ed70",
|
53
|
+
"Result": true
|
54
|
+
}
|
55
|
+
}
|
56
|
+
```
|
57
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
**Example 1: 验证已签名的可验证凭证**
|
2
|
+
|
3
|
+
验证凭证颁发者签发的可验证凭证
|
4
|
+
|
5
|
+
Input:
|
6
|
+
|
7
|
+
```
|
8
|
+
tccli tdid VerifyCredentials --cli-unfold-argument \
|
9
|
+
--DAPId 1 \
|
10
|
+
--CredentialData {"claim":{"age":18,"id":"did:tdid:w1:0x3b67623cbdaa9ccbfc8b7c346588c6bcbc6f5d63","name":"zhang san"},"context":"https://github.com/WeBankFinTech/WeIdentity/blob/master/context/v1","CPTId":12000000,"expirationDate":1871212353,"id":"42e180f9-e4fd-4cd0-93a6-1770f1f69c44","issuanceDate":1628063788,"issuer":"did:tdid:w1:0x4c59267a10ed54857842674d0c76ab708c6275f5","proof":{"created":1628063788,"creator":"did:tdid:w1:0x4c59267a10ed54857842674d0c76ab708c6275f5#keys-0","salt":{"age":"KeMT6","id":"qGZIB","name":"8jMxZ"},"signatureValue":"mf9UEjhh2gIpxr2evRh+zbC2/1k4YyxKl4otn2v96wQfNrz3MKQ+nsc0P0H/hFNlh3F+8Z1gN9qSemWXyN8KAwA=","type":"Secp256k1"},"type":["VerifiableCredential","original"]}
|
11
|
+
```
|
12
|
+
|
13
|
+
Output:
|
14
|
+
```
|
15
|
+
{
|
16
|
+
"Response": {
|
17
|
+
"Result": true,
|
18
|
+
"VerifyCode": 0,
|
19
|
+
"VerifyMessage": "success",
|
20
|
+
"RequestId": "eac6b301-a322-493a-8e36-83b295459397"
|
21
|
+
}
|
22
|
+
}
|
23
|
+
```
|
24
|
+
|