Skip to content

Commit 7268e3c

Browse files
committed
Finalized all certs by SKID
1 parent d524133 commit 7268e3c

File tree

5 files changed

+192
-154
lines changed

5 files changed

+192
-154
lines changed

docs/transactions.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ Please make sure that TLS is enabled in gRPC, REST or Light Client Proxy for sec
170170
| **GLOBAL - Work for all certificate types (DA, NOC)** | |
171171
| [GET_CERT](transactions/pki.md#get_cert) <br><br> Gets a certificate (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki cert --subject=<base64 string> --subject-key-id=<hex string>` <br><br> GET `/dcl/pki/all-certificates/{subject}/{subject_key_id}` |
172172
| [GET_ALL_CERTS](transactions/pki.md#get_all_certs) <br><br> Gets all certificates (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki all-certs` <br><br> GET `/dcl/pki/all-certificates` |
173-
| [GET_ALL_CERTS_BY_SUBJECT](transactions/pki.md#get_all_certs_by_subject) <br><br> | CLI `dcld query pki all-subject-certs --subject=<base64 string>` <br><br> GET `/dcl/pki/all-certificates/{subject}` |
173+
| [GET_ALL_CERTS_BY_SUBJECT](transactions/pki.md#get_all_certs_by_subject) <br><br> Gets all certificates associated with a subject (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki all-subject-certs --subject=<base64 string>` <br><br> GET `/dcl/pki/all-certificates/{subject}` |
174+
| [GET_ALL_CERTS_BY_SKID](transactions/pki.md#get_all_certs_by_skid) <br><br> Gets all certificates by the given subject key ID (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki cert --subject-key-id=<hex string>` <br><br> GET `/dcl/pki/all-certificates?subjectKeyId={subjectKeyId}` |
174175
| [GET_CHILD_CERTS](transactions/pki.md#get_child_certs) <br><br> Gets all child certificates for the given certificate (PAA, PAI, RCAC, ICAC) | CLI `dcld query pki all-child-x509-certs --subject=<base64 string> --subject-key-id=<hex string>` <br><br> GET `/dcl/pki/child-certificates/{subject}/{subject_key_id}` |
175176
| **DA - Work for DA certificate types (PAA, PAI)** | |
176177
| [PROPOSE_ADD_PAA](transactions/pki.md#propose_add_paa) <br><br> Proposes a new PAA (self-signed root certificate) | CLI `dcld tx pki propose-add-x509-root-cert --certificate=<string-or-path>` <br><br> POST `/cosmos/tx/v1beta1/txs`([MsgProposeAddX509RootCert](https://github.com/zigbee-alliance/distributed-compliance-ledger/blob/master/proto/zigbeealliance/distributedcomplianceledger/pki/tx.proto#L34)) |

docs/transactions/pki.md

+18
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,24 @@ Use [GET_ALL_REVOKED_NOC_ICA_CERTS](#get_all_revoked_noc_ica-icacs) to get a lis
6767
- REST API:
6868
- GET `/dcl/pki/all-certificates/{subject}`
6969

70+
#### GET_ALL_CERTS_BY_SKID
71+
72+
**Status: Implemented**
73+
74+
Gets all certificates by the given subject key ID attribute. This query works for all types certificates (PAA, PAI, RCAC, ICAC).
75+
76+
Revoked certificates are not returned.
77+
Use [GET_ALL_REVOKED_DA_CERTS](#get_all_revoked_da_certs) to get a list of all revoked DA certificates.
78+
Use [GET_ALL_REVOKED_NOC_ROOT_CERTS](#get_all_revoked_noc_root-rcacs) to get a list of all revoked Noc Root certificates.
79+
Use [GET_ALL_REVOKED_NOC_ICA_CERTS](#get_all_revoked_noc_ica-icacs) to get a list of all revoked Noc ICA certificates.
80+
81+
- Parameters:
82+
- subject_key_id: `string` - certificates's `Subject Key Id` in hex string format, e.g: `5A:88:0E:6C:36:53:D0:7F:B0:89:71:A3:F4:73:79:09:30:E6:2B:DB`
83+
- CLI command:
84+
- `dcld query pki cert --subject-key-id=<hex string>`
85+
- REST API:
86+
- GET `/dcl/pki/all-certificates?subjectKeyId={subjectKeyId}`
87+
7088
#### GET_CHILD_CERTS
7189

7290
**Status: Implemented**

integration_tests/cli/pki-combine-certs.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ test_divider
285285

286286
echo "Request certificates by subject key id"
287287
echo "Request DA certificate using global command"
288-
result=$(dcld query pki certs --subject-key-id="$da_root_subject_key_id")
288+
result=$(dcld query pki cert --subject-key-id="$da_root_subject_key_id")
289289
echo $result | jq
290290
check_response "$result" "\"subjectKeyId\": \"$da_root_subject_key_id\""
291291

292292
echo "Request NOC certificate using global command"
293-
result=$(dcld query pki certs --subject-key-id="$noc_root_subject_key_id")
293+
result=$(dcld query pki cert --subject-key-id="$noc_root_subject_key_id")
294294
echo $result | jq
295295
check_response "$result" "\"subjectKeyId\": \"$noc_root_subject_key_id\""
296296

0 commit comments

Comments
 (0)