From 78ce3831e4ccb171ee9109715a1c076a0c932eff Mon Sep 17 00:00:00 2001 From: "artem.ivanov" Date: Thu, 7 Nov 2024 13:10:02 +0300 Subject: [PATCH] Added index for certificates by subject --- .github/workflows/verify.yml | 2 +- README-DEV.md | 4 +- README.md | 16 +- docs/design/noc-root-cert-design.md | 2 +- docs/how-to.md | 2 +- docs/pool-upgrade-how-to.md | 4 +- docs/pool-upgrade.md | 6 +- docs/static/openapi.yml | 10 +- docs/{transactions => }/transactions.md | 44 +- integration_tests/cli/pki-combine-certs.sh | 12 + .../grpc_rest/pki/noc_cert_helpers.go | 6 +- .../pki/all_certificates_by_subject.proto | 12 + .../pki/genesis.proto | 2 + .../pki/query.proto | 21 +- .../module.ts | 108 +- .../registry.ts | 12 +- .../module.ts | 96 +- .../registry.ts | 12 +- .../module.ts | 58 +- .../registry.ts | 4 +- .../module.ts | 118 +- .../registry.ts | 12 +- .../rest.ts | 5 +- .../model/model.ts | 59 +- .../distributedcomplianceledger/model/tx.ts | 108 +- .../api.swagger.yml | 4 +- .../module.ts | 428 +- .../registry.ts | 48 +- .../rest.ts | 358 +- .../types.ts | 16 +- .../pki/all_certificates.ts | 107 + .../pki/all_certificates_by_subject.ts | 96 + .../pki/certificate.ts | 55 +- .../pki/genesis.ts | 150 +- .../pki/noc_certificates.ts | 48 +- .../pki/noc_certificates_by_subject.ts | 96 + .../pki/noc_certificates_by_subject_key_id.ts | 109 + .../pki/noc_certificates_by_vid_and_skid.ts | 117 + .../distributedcomplianceledger/pki/query.ts | 3447 +++++++++++------ .../pki/revoked_noc_ica_certificates.ts | 107 + .../module.ts | 108 +- .../registry.ts | 12 +- .../module/rest.ts | 12 +- x/pki/client/cli/query.go | 1 + .../cli/query_all_certificates_by_subject.go | 43 + .../query_all_certificates_by_subject_test.go | 162 + x/pki/genesis.go | 5 + x/pki/genesis_test.go | 9 + x/pki/keeper/all_certificates_by_subject.go | 129 + .../all_certificates_by_subject_test.go | 63 + x/pki/keeper/child_certificates.go | 6 + .../grpc_query_all_certificates_by_subject.go | 27 + ..._query_all_certificates_by_subject_test.go | 68 + x/pki/keeper/keeper.go | 2 + x/pki/keeper/migrations.go | 16 +- x/pki/keeper/migrations_test.go | 19 + .../msg_server_add_noc_x_509_root_cert.go | 3 + x/pki/keeper/msg_server_add_x_509_cert.go | 3 + .../msg_server_approve_add_x_509_root_cert.go | 3 + ...g_server_approve_revoke_x_509_root_cert.go | 2 + .../msg_server_remove_noc_x_509_ica_cert.go | 2 + .../msg_server_remove_noc_x_509_root_cert.go | 2 + x/pki/keeper/msg_server_remove_x_509_cert.go | 2 + .../msg_server_revoke_noc_x_509_ica_cert.go | 3 + .../msg_server_revoke_noc_x_509_root_cert.go | 3 + x/pki/keeper/msg_server_revoke_x_509_cert.go | 3 + x/pki/module.go | 1 - x/pki/types/all_certificates_by_subject.pb.go | 412 ++ x/pki/types/genesis.go | 11 + x/pki/types/genesis.pb.go | 185 +- x/pki/types/genesis_test.go | 22 + .../types/key_all_certificates_by_subject.go | 23 + x/pki/types/query.pb.go | 832 ++-- x/pki/types/query.pb.gw.go | 107 +- 74 files changed, 6046 insertions(+), 2176 deletions(-) rename docs/{transactions => }/transactions.md (98%) create mode 100644 proto/zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.proto create mode 100644 ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/all_certificates.ts create mode 100644 ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.ts create mode 100644 ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject.ts create mode 100644 ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject_key_id.ts create mode 100644 ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_vid_and_skid.ts create mode 100644 ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/revoked_noc_ica_certificates.ts create mode 100644 x/pki/client/cli/query_all_certificates_by_subject.go create mode 100644 x/pki/client/cli/query_all_certificates_by_subject_test.go create mode 100644 x/pki/keeper/all_certificates_by_subject.go create mode 100644 x/pki/keeper/all_certificates_by_subject_test.go create mode 100644 x/pki/keeper/grpc_query_all_certificates_by_subject.go create mode 100644 x/pki/keeper/grpc_query_all_certificates_by_subject_test.go create mode 100644 x/pki/types/all_certificates_by_subject.pb.go create mode 100644 x/pki/types/key_all_certificates_by_subject.go diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index a86c9c94b..ff79d5f5c 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -125,7 +125,7 @@ jobs: ${{ runner.os }}-go- - name: Run integration tests shell: bash - run: integration_tests/run-all.sh upgrade + run: integration_tests/run-all.sh lint: if: needs.changes.outputs.go == 'true' name: Check linter issues with golangci-lint tool diff --git a/README-DEV.md b/README-DEV.md index b153def5b..faab8115e 100644 --- a/README-DEV.md +++ b/README-DEV.md @@ -125,7 +125,7 @@ Start a local pool as described above, and then just execute dcld ``` -Have a look at [How To](docs/how-to.md) and [transactions](docs/transactions/transactions.md) for instructions how to configure and use the CLI. +Have a look at [How To](docs/how-to.md) and [transactions](docs/transactions.md) for instructions how to configure and use the CLI. ## REST @@ -133,7 +133,7 @@ Start a local pool as described above. Every node exposes a REST API at `http://:1317` (see ). -Have a look at [transactions](docs/transactions/transactions.md) for a full list of REST endpoints. +Have a look at [transactions](docs/transactions.md) for a full list of REST endpoints. ## Contributing diff --git a/README.md b/README.md index 94a432637..cb20d3080 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,8 @@ DC Ledger is based on [CometBFT](https://cometbft.com/) and [Cosmos SDK](https:/ DC Ledger is a public permissioned ledger in the following sense: -- Anyone can read from the ledger (that's why it's public). See [How to read from the Ledger](docs/transactions/transactions.md#how-to-read-from-the-ledger). -- Writes to the ledger are permissioned. See [How to write to the Ledger](docs/transactions/transactions.md#how-to-write-to-the-ledger) for details. +- Anyone can read from the ledger (that's why it's public). See [How to read from the Ledger](docs/transactions.md#how-to-read-from-the-ledger). +- Writes to the ledger are permissioned. See [How to write to the Ledger](docs/transactions.md#how-to-write-to-the-ledger) for details. - PoA (proof of authority) approach is used for adding new validator nodes to the network (see [Add New Node Use Case](docs/use_cases/use_cases_add_validator_node.png)) and [Running Node](docs/running-node.md). @@ -117,7 +117,7 @@ See [Run local pool](README-DEV.md#run-local-pool) section in [README-DEV.md](RE ### CLI - The same `dcld` binary as a Node -- A full list of all CLI commands can be found there: [transactions.md](docs/transactions/transactions.md). +- A full list of all CLI commands can be found there: [transactions.md](docs/transactions.md). - CLI can be used for write and read requests. - Please configure the CLI before using (see [how-to.md](docs/how-to.md#cli-configuration)). - **If there are no trusted Observer or Validator nodes to connect a CLI, then a [Light Client Proxy](#light-client-proxy) can be used.** @@ -140,12 +140,12 @@ See [Run Light Client Proxy](docs/running-light-client-proxy.md) for details how - **There are no state proofs in REST, so REST queries should be sent to trusted Validator or Observer nodes only.** - OpenAPI specification: . - Any running node exposes a REST API at port `1317`. See . -- See [transactions](docs/transactions/transactions.md) for a full list of endpoints. +- See [transactions](docs/transactions.md) for a full list of endpoints. - REST HTTP(S) queries can be directly used for read requests. - See [How to read from the Ledger](docs/transactions/transactions.md#how-to-read-from-the-ledger). + See [How to read from the Ledger](docs/transactions.md#how-to-read-from-the-ledger). - REST HTTP(S) queries can be directly used to broadcast generated and signed transaction. - Generation and signing of transactions need to be done in code or via CLI. - See [How to write to the Ledger](docs/transactions/transactions.md#how-to-write-to-the-ledger). + See [How to write to the Ledger](docs/transactions.md#how-to-write-to-the-ledger). ### gRPC @@ -153,7 +153,7 @@ See [Run Light Client Proxy](docs/running-light-client-proxy.md) for details how - Any running node exposes a REST API at port `9090`. See . - A client code can be generated for all popular languages from the proto files [proto](proto), see . - The generated client code can be used for read and write requests, i.e. generation and signing of transactions - See [How to read from the Ledger](docs/transactions/transactions.md#how-to-read-from-the-ledger) and [How to write to the Ledger](docs/transactions/transactions.md#how-to-write-to-the-ledger) for details. + See [How to read from the Ledger](docs/transactions.md#how-to-read-from-the-ledger) and [How to write to the Ledger](docs/transactions.md#how-to-write-to-the-ledger) for details. ### CometBFT RPC and Light Client @@ -209,7 +209,7 @@ the following instructions from [how-to.md](docs/how-to.md) can be used for ever - [OpenAPI specification](https://zigbee-alliance.github.io/distributed-compliance-ledger/) - [Quick Start](docs/quickStartGuide.adoc) -- [List of Transactions, Queries, CLI command, REST API](docs/transactions/transactions.md) +- [List of Transactions, Queries, CLI command, REST API](docs/transactions.md) - [How To Guide](docs/how-to.md) - [Use Case Diagrams](docs/use_cases) - [PKI](docs/use_cases/use_cases_pki.png) diff --git a/docs/design/noc-root-cert-design.md b/docs/design/noc-root-cert-design.md index 9becdb691..00d6f1879 100644 --- a/docs/design/noc-root-cert-design.md +++ b/docs/design/noc-root-cert-design.md @@ -96,7 +96,7 @@ Retrieve NOC root certificates associated with a specific VID. - CLI Command: - `dcld query pki get_noc_x509_root_certs --vid=` - REST API: - - GET `/dcl/pki/noc-root-certificates/{vid}` + - GET `/dcl/pki/noc-vid-root-certificates/{vid}` ### GET_ALL_NOC_X509_ROOT_CERTS diff --git a/docs/how-to.md b/docs/how-to.md index 548da3562..f3c0541f0 100644 --- a/docs/how-to.md +++ b/docs/how-to.md @@ -6,7 +6,7 @@ This document contains tutorials demonstrating how to accomplish common tasks us - If write requests to the Ledger needs to be sent, please make sure that you have an Account created on the Ledger with an appropriate role (see [Getting Account](#getting-account) section in [how-to.md](how-to.md)). - Sending read requests to the Ledger doesn't require an Account (Ledger is public for reads). -- A full list of all CLI commands with all parameters can be found there: [transactions](transactions/transactions.md). +- A full list of all CLI commands with all parameters can be found there: [transactions](transactions.md). - After the CLI is configured and Account with an appropriate role is created, the following instructions can be used for every role (see [Use Case Diagrams](use_cases)): - [Trustee](#trustee-instructions) diff --git a/docs/pool-upgrade-how-to.md b/docs/pool-upgrade-how-to.md index 1b692faf3..3cc7f1ee6 100644 --- a/docs/pool-upgrade-how-to.md +++ b/docs/pool-upgrade-how-to.md @@ -60,7 +60,7 @@ One of the trustees proposes the upgrade using the following steps: ``` Please note, that it must be called against the `dcld` binary, not the platform archive itself. So, for Ubuntu, either take a `dcld` binary from the root folder of the release, or extract it from ` dcld.ubuntu.tar.gz`. - 2. Sends [`ProposeUpgrade`](transactions/transactions.md#propose_upgrade) transaction + 2. Sends [`ProposeUpgrade`](transactions.md#propose_upgrade) transaction with the name of the new upgrade handler, the chosen ledger height and the info containing URLs of the new application version binaries for supported platforms with the calculated checksums. @@ -92,7 +92,7 @@ Each of them uses the following steps to accomplish this: ``` Please note, that it must be called against the `dcld` binary, not the platform archive itself. So, for Ubuntu, either take a `dcld` binary from the root folder of the release, or extract it from ` dcld.ubuntu.tar.gz`. -2. Sends [`ApproveUpgrade`](transactions/transactions.md#approve_upgrade) transaction +2. Sends [`ApproveUpgrade`](transactions.md#approve_upgrade) transaction with the name of the proposed upgrade. For example: diff --git a/docs/pool-upgrade.md b/docs/pool-upgrade.md index 902972e9f..019c7159b 100644 --- a/docs/pool-upgrade.md +++ b/docs/pool-upgrade.md @@ -27,10 +27,10 @@ Any upgrade plan has the following fields: ## Workflow Initially an upgrade plan is proposed by one of trustees using -[propose-upgrade](transactions/transactions.md#propose_upgrade) command. Then the proposed +[propose-upgrade](transactions.md) command. Then the proposed upgrade plan has to be approved by the majority of trustees (2/3 including the trustee who has proposed it) using -[approve-upgrade](transactions/transactions.md#approve_upgrade) command. When the necessary +[approve-upgrade](transactions.md#approve_upgrade) command. When the necessary count of approvals is gathered, the upgrade plan turns into the approved state and is actually scheduled. @@ -81,5 +81,5 @@ checksum when the URL is provided in the specified format. If the downloaded file checksum does not equal to the checksum provided in the URL, `go-getter` reports that checksums did not match. To view `Info` field value of an upgrade plan, just execute an appropriate query command from `dclupgrade` or `upgrade` -module. See [Upgrade CLI commands reference](transactions/transactions.md#upgrade) for +module. See [Upgrade CLI commands reference](transactions.md#upgrade) for details. diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 326e2ad3e..67182da64 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -10209,7 +10209,7 @@ paths: type: string tags: - Query - /dcl/pki/noc-certificates/{subject}: + /dcl/pki/all-noc-certificates/{subject}: get: summary: Queries a NocCertificatesBySubject by index. operationId: NocCertificatesBySubject @@ -10256,7 +10256,7 @@ paths: type: string tags: - Query - /dcl/pki/noc-certificates/{subject}/{subjectKeyId}: + /dcl/pki/all-noc-certificates/{subject}/{subjectKeyId}: get: summary: Queries a NocCertificates by index. operationId: NocCertificates @@ -10384,7 +10384,7 @@ paths: type: string tags: - Query - /dcl/pki/noc-certificates/{vid}/{subjectKeyId}: + /dcl/pki/noc-vid-certificates/{vid}/{subjectKeyId}: get: summary: Queries a NocCertificatesByVidAndSkid by index. operationId: NocCertificatesByVidAndSkid @@ -10716,7 +10716,7 @@ paths: type: boolean tags: - Query - /dcl/pki/noc-ica-certificates/{vid}: + /dcl/pki/noc-vid-ica-certificates/{vid}: get: summary: Queries a NocIcaCertificates by index. operationId: NocIcaCertificates @@ -11039,7 +11039,7 @@ paths: type: boolean tags: - Query - /dcl/pki/noc-root-certificates/{vid}: + /dcl/pki/noc-vid-root-certificates/{vid}: get: summary: Queries a NocRootCertificates by index. operationId: NocRootCertificates diff --git a/docs/transactions/transactions.md b/docs/transactions.md similarity index 98% rename from docs/transactions/transactions.md rename to docs/transactions.md index 551199ae6..8498259bf 100644 --- a/docs/transactions/transactions.md +++ b/docs/transactions.md @@ -21,7 +21,7 @@ See use case sequence diagrams for the examples of how transaction can be used. - Every writer to the Ledger must - Have a private/public key pair. - - Have an Account created on the ledger via `ACCOUNT` transaction (see [Use Case Txn Auth](../use_cases/use_cases_txn_auth.puml)). + - Have an Account created on the ledger via `ACCOUNT` transaction (see [Use Case Txn Auth](use_cases/use_cases_txn_auth.puml)). - The Account stores the public part of the key - The Account has an associated role. The role is used for authorization policies. - Sign every transaction by the private key. @@ -38,9 +38,9 @@ an Account or sign the request. - Local CLI - Configure the CLI before using. - See `CLI Configuration` section in [how-to.md](../how-to.md#cli-configuration). + See `CLI Configuration` section in [how-to.md](how-to.md#cli-configuration). - Generate and store a private key for the Account to be used for sending. - See `Getting Account` section in [how-to.md](../how-to.md#getting-account). + See `Getting Account` section in [how-to.md](how-to.md#getting-account). - Send transactions to the ledger from the Account (`--from`). - it will automatically build a request, sign it by the account's key, and broadcast to the ledger. - See `CLI` sub-sections for every write request (transaction). @@ -54,9 +54,9 @@ an Account or sign the request. - Broadcast transaction by CLI 1: `dcld tx broadcast txn.json` - To get the actual result of transaction, `dcld query tx=txHash` call must be executed, where `txHash` is the hash of previously executed transaction. - gRPC: - - Generate a client code from the proto files [proto](../../proto) for the client language (see ) + - Generate a client code from the proto files [proto](../proto) for the client language (see ) - Build, sign, and broadcast the message (transaction). - See [grpc/rest integration tests](../../integration_tests/grpc_rest) as an example. + See [grpc/rest integration tests](../integration_tests/grpc_rest) as an example. - REST API - Build and sign a transaction by one of the following ways - In code via gRPC (see above) @@ -81,17 +81,17 @@ Please make sure that TLS is enabled in gRPC, REST or Light Client Proxy for sec - Local CLI - See `CLI` section for every read request. - - If there are no trusted Observer or Validator nodes to connect a CLI, then a [Light Client Proxy](../running-light-client-proxy.md) can be used. + - If there are no trusted Observer or Validator nodes to connect a CLI, then a [Light Client Proxy](running-light-client-proxy.md) can be used. - REST API - OpenAPI specification: . - Any running node exposes a REST API at port `1317`. See . - See `REST API` section for every read request. - - See [grpc/rest integration tests](../../integration_tests/grpc_rest) as an example. + - See [grpc/rest integration tests](../integration_tests/grpc_rest) as an example. - There are no state proofs in REST, so REST queries should be sent to trusted Validator or Observer nodes only. - gRPC - Any running node exposes a REST API at port `9090`. See . - - Generate a client code from the proto files [proto](../../proto) for the client language (see ). - - See [grpc/rest integration tests](../../integration_tests/grpc_rest) as an example. + - Generate a client code from the proto files [proto](../proto) for the client language (see ). + - See [grpc/rest integration tests](../integration_tests/grpc_rest) as an example. - There are no state proofs in gRPC, so gRPC queries should be sent to trusted Validator or Observer nodes only. - Tendermint RPC - Tendermint RPC OpenAPI specification can be found in . @@ -99,7 +99,7 @@ Please make sure that TLS is enabled in gRPC, REST or Light Client Proxy for sec - Tendermint RPC supports state proofs. Tendermint's Light Client library can be used to verify the state proofs. So, if Light Client API is used, then it's possible to communicate with non-trusted nodes. - Please note, that multi-value queries don't have state proofs support and should be sent to trusted nodes only. - - Refer to [this doc](../cometbft-rpc.md) to see how to [subscribe](../cometbft-rpc.md#subscribe) to a Tendermint WebSocket based events and/or [query](../cometbft-rpc.md#querying-application-components) an application components. + - Refer to [this doc](cometbft-rpc.md) to see how to [subscribe](cometbft-rpc.md#subscribe) to a Tendermint WebSocket based events and/or [query](cometbft-rpc.md#querying-application-components) an application components. `NotFound` (404 code) is returned if an entry is not found on the ledger. @@ -1650,7 +1650,7 @@ Use [GET_ALL_REVOKED_NOC_ROOT](#get_all_revoked_noc_root-rcacs) to get a list of - CLI Command: - `dcld query pki noc-x509-root-certs --vid=` - REST API: - - GET `/dcl/pki/noc-root-certificates/{vid}` + - GET `/dcl/pki/noc-vid-root-certificates/{vid}` #### GET_NOC_BY_VID_AND_SKID (RCACs/ICACs) @@ -1670,7 +1670,7 @@ Use [GET_ALL_REVOKED_NOC_ICA](#get_all_revoked_noc_ica-icacs) to get a list of a - CLI Command: - `dcld query pki noc-x509-certs --vid= --subject-key-id=` - REST API: - - GET `/dcl/pki/noc-certificates/{vid}/{subject_key_id}` + - GET `/dcl/pki/noc-vid-certificates/{vid}/{subject_key_id}` #### GET_NOC_ICA_BY_VID (ICACs) @@ -1687,7 +1687,7 @@ Use [GET_ALL_REVOKED_CERT](#get_all_revoked_certs) to get a list of all revoked - CLI Command: - `dcld query pki noc-x509-ica-certs --vid=` - REST API: - - GET `/dcl/pki/noc-ica-certificates/{vid}` + - GET `/dcl/pki/noc-vid-ica-certificates/{vid}` #### GET_NOC_CERTS_BY_SUBJECT @@ -1858,6 +1858,24 @@ Should be sent to trusted nodes only. - REST API: - GET `/dcl/pki/all-certificates` +#### GET_CERTS_BY_SUBJECT + +**Status: Implemented** + +Gets all certificates associated with a subject. This query works for all types of certificates (PAA, PAI, RCAC, ICAC). + +Revoked certificates are not returned. +Use [GET_ALL_REVOKED_DA_CERTS](#get_all_revoked_da_certs) to get a list of all revoked DA certificates. +Use [GET_ALL_REVOKED_NOC_ROOT_CERTS](#get_all_revoked_noc_root-rcacs) to get a list of all revoked Noc Root certificates. +Use [GET_ALL_REVOKED_NOC_ICA_CERTS](#get_all_revoked_noc_ica-icacs) to get a list of all revoked Noc ICA certificates. + +- Parameters: + - subject: `string` - certificates's `Subject` is base64 encoded subject DER sequence bytes +- CLI command: + - `dcld query pki all-subject-certs --subject=` +- REST API: + - GET `/dcl/pki/all-certificates/{subject}` + #### GET_CHILD_CERTS **Status: Implemented** diff --git a/integration_tests/cli/pki-combine-certs.sh b/integration_tests/cli/pki-combine-certs.sh index 17a81973d..23fa96e5a 100755 --- a/integration_tests/cli/pki-combine-certs.sh +++ b/integration_tests/cli/pki-combine-certs.sh @@ -283,6 +283,18 @@ response_does_not_contain "$result" "\"subjectKeyId\": \"$da_root_subject_key_id test_divider +echo "Request DA certificates by subject using global command" +result=$(dcld query pki all-subject-certs --subject=$da_root_subject) +echo $result | jq +check_response "$result" "\"$da_root_subject\"" +check_response "$result" "\"$da_root_subject_key_id\"" + +echo "Request NOC certificates by subject using global command" +result=$(dcld query pki all-subject-certs --subject=$noc_root_subject) +echo $result | jq +check_response "$result" "\"$noc_root_subject\"" +check_response "$result" "\"$noc_root_subject_key_id\"" + echo "Request all DA certificates by subject must be empty" result=$(dcld query pki all-subject-x509-certs --subject="$da_root_subject") echo $result | jq diff --git a/integration_tests/grpc_rest/pki/noc_cert_helpers.go b/integration_tests/grpc_rest/pki/noc_cert_helpers.go index 23f466961..847a6e975 100644 --- a/integration_tests/grpc_rest/pki/noc_cert_helpers.go +++ b/integration_tests/grpc_rest/pki/noc_cert_helpers.go @@ -190,7 +190,7 @@ func GetNocX509RootCerts(suite *utils.TestSuite, vendorID int32) (*pkitypes.NocR var res pkitypes.NocRootCertificates if suite.Rest { var resp pkitypes.QueryGetNocRootCertificatesResponse - err := suite.QueryREST(fmt.Sprintf("/dcl/pki/noc-root-certificates/%v", vendorID), &resp) + err := suite.QueryREST(fmt.Sprintf("/dcl/pki/noc-vid-root-certificates/%v", vendorID), &resp) if err != nil { return nil, err } @@ -218,7 +218,7 @@ func GetNocX509CertsByVidAndSkid(suite *utils.TestSuite, vendorID int32, subject var res pkitypes.NocCertificatesByVidAndSkid if suite.Rest { var resp pkitypes.QueryGetNocCertificatesByVidAndSkidResponse - err := suite.QueryREST(fmt.Sprintf("/dcl/pki/noc-certificates/%v/%s", vendorID, url.QueryEscape(subjectKeyID)), &resp) + err := suite.QueryREST(fmt.Sprintf("/dcl/pki/noc-vid-certificates/%v/%s", vendorID, url.QueryEscape(subjectKeyID)), &resp) if err != nil { return nil, err } @@ -246,7 +246,7 @@ func GetNocX509IcaCerts(suite *utils.TestSuite, vendorID int32) (*pkitypes.NocIc var res pkitypes.NocIcaCertificates if suite.Rest { var resp pkitypes.QueryGetNocIcaCertificatesResponse - err := suite.QueryREST(fmt.Sprintf("/dcl/pki/noc-ica-certificates/%v", vendorID), &resp) + err := suite.QueryREST(fmt.Sprintf("/dcl/pki/noc-vid-ica-certificates/%v", vendorID), &resp) if err != nil { return nil, err } diff --git a/proto/zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.proto b/proto/zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.proto new file mode 100644 index 000000000..b1ee80b1a --- /dev/null +++ b/proto/zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package zigbeealliance.distributedcomplianceledger.pki; + +option go_package = "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types"; + +message AllCertificatesBySubject { + string subject = 1; + repeated string subjectKeyIds = 2; + uint32 schemaVersion = 3; + +} + diff --git a/proto/zigbeealliance/distributedcomplianceledger/pki/genesis.proto b/proto/zigbeealliance/distributedcomplianceledger/pki/genesis.proto index 9a55e46c5..f81c35a80 100644 --- a/proto/zigbeealliance/distributedcomplianceledger/pki/genesis.proto +++ b/proto/zigbeealliance/distributedcomplianceledger/pki/genesis.proto @@ -23,6 +23,7 @@ import "zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subje import "zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_vid_and_skid.proto"; import "zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject.proto"; import "zigbeealliance/distributedcomplianceledger/pki/all_certificates.proto"; +import "zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.proto"; // this line is used by starport scaffolding # genesis/proto/import import "gogoproto/gogo.proto"; @@ -52,5 +53,6 @@ message GenesisState { repeated NocCertificatesBySubject nocCertificatesBySubjectList = 20 [(gogoproto.nullable) = false]; repeated AllCertificates certificatesList = 21 [(gogoproto.nullable) = false]; repeated RevokedNocIcaCertificates revokedNocIcaCertificatesList = 22 [(gogoproto.nullable) = false]; + repeated AllCertificatesBySubject allCertificatesBySubjectList = 23 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/proto/zigbeealliance/distributedcomplianceledger/pki/query.proto b/proto/zigbeealliance/distributedcomplianceledger/pki/query.proto index 4afe46b78..ebb6433e5 100644 --- a/proto/zigbeealliance/distributedcomplianceledger/pki/query.proto +++ b/proto/zigbeealliance/distributedcomplianceledger/pki/query.proto @@ -15,6 +15,7 @@ import "zigbeealliance/distributedcomplianceledger/pki/rejected_certificate.prot import "zigbeealliance/distributedcomplianceledger/pki/pki_revocation_distribution_point.proto"; import "zigbeealliance/distributedcomplianceledger/pki/pki_revocation_distribution_points_by_issuer_subject_key_id.proto"; import "zigbeealliance/distributedcomplianceledger/pki/all_certificates.proto"; +import "zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.proto"; import "zigbeealliance/distributedcomplianceledger/pki/noc_certificates.proto"; import "zigbeealliance/distributedcomplianceledger/pki/noc_root_certificates.proto"; import "zigbeealliance/distributedcomplianceledger/pki/noc_ica_certificates.proto"; @@ -38,6 +39,11 @@ service Query { option (google.api.http).get = "/dcl/pki/all-certificates"; } + // Queries a AllCertificatesBySubject by index. + rpc AllCertificatesBySubject(QueryGetAllCertificatesBySubjectRequest) returns (QueryGetAllCertificatesBySubjectResponse) { + option (google.api.http).get = "/dcl/pki/all-certificates/{subject}"; + } + // Queries a Certificates by index. rpc Certificates(QueryGetCertificatesRequest) returns (QueryGetCertificatesResponse) { option (google.api.http).get = "/dcl/pki/all-certificates/{subject}/{subjectKeyId}"; @@ -143,12 +149,12 @@ service Query { // Queries a NocCertificatesByVidAndSkid by index. rpc NocCertificatesByVidAndSkid(QueryGetNocCertificatesByVidAndSkidRequest) returns (QueryGetNocCertificatesByVidAndSkidResponse) { - option (google.api.http).get = "/dcl/pki/noc-certificates/{vid}/{subjectKeyId}"; + option (google.api.http).get = "/dcl/pki/noc-vid-certificates/{vid}/{subjectKeyId}"; } // Queries a NocRootCertificates by index. rpc NocRootCertificates(QueryGetNocRootCertificatesRequest) returns (QueryGetNocRootCertificatesResponse) { - option (google.api.http).get = "/dcl/pki/noc-root-certificates/{vid}"; + option (google.api.http).get = "/dcl/pki/noc-vid-root-certificates/{vid}"; } // Queries a list of NocRootCertificates items. @@ -158,7 +164,7 @@ service Query { // Queries a NocIcaCertificates by index. rpc NocIcaCertificates(QueryGetNocIcaCertificatesRequest) returns (QueryGetNocIcaCertificatesResponse) { - option (google.api.http).get = "/dcl/pki/noc-ica-certificates/{vid}"; + option (google.api.http).get = "/dcl/pki/noc-vid-ica-certificates/{vid}"; } // Queries a list of NocIcaCertificates items. @@ -198,6 +204,14 @@ message QueryAllCertificatesResponse { cosmos.base.query.v1beta1.PageResponse pagination = 2; } +message QueryGetAllCertificatesBySubjectRequest { + string subject = 1; +} + + message QueryGetAllCertificatesBySubjectResponse { + AllCertificatesBySubject allCertificatesBySubject = 1 [(gogoproto.nullable) = false]; +} + message QueryGetCertificatesRequest { string subject = 1; string subjectKeyId = 2; @@ -305,7 +319,6 @@ message QueryGetRevokedRootCertificatesResponse { } message QueryGetApprovedCertificatesBySubjectRequest { string subject = 1; - } message QueryGetApprovedCertificatesBySubjectResponse { diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.compliance/module.ts b/ts-client/zigbeealliance.distributedcomplianceledger.compliance/module.ts index b6054be06..89b7437e7 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.compliance/module.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.compliance/module.ts @@ -7,11 +7,11 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgRevokeModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; -import { MsgCertifyModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; import { MsgUpdateComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; -import { MsgProvisionModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; import { MsgDeleteComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; +import { MsgCertifyModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; +import { MsgRevokeModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; +import { MsgProvisionModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; import { CertifiedModel as typeCertifiedModel} from "./types" import { ComplianceHistoryItem as typeComplianceHistoryItem} from "./types" @@ -20,10 +20,16 @@ import { DeviceSoftwareCompliance as typeDeviceSoftwareCompliance} from "./types import { ProvisionalModel as typeProvisionalModel} from "./types" import { RevokedModel as typeRevokedModel} from "./types" -export { MsgRevokeModel, MsgCertifyModel, MsgUpdateComplianceInfo, MsgProvisionModel, MsgDeleteComplianceInfo }; +export { MsgUpdateComplianceInfo, MsgDeleteComplianceInfo, MsgCertifyModel, MsgRevokeModel, MsgProvisionModel }; -type sendMsgRevokeModelParams = { - value: MsgRevokeModel, +type sendMsgUpdateComplianceInfoParams = { + value: MsgUpdateComplianceInfo, + fee?: StdFee, + memo?: string +}; + +type sendMsgDeleteComplianceInfoParams = { + value: MsgDeleteComplianceInfo, fee?: StdFee, memo?: string }; @@ -34,8 +40,8 @@ type sendMsgCertifyModelParams = { memo?: string }; -type sendMsgUpdateComplianceInfoParams = { - value: MsgUpdateComplianceInfo, +type sendMsgRevokeModelParams = { + value: MsgRevokeModel, fee?: StdFee, memo?: string }; @@ -46,33 +52,27 @@ type sendMsgProvisionModelParams = { memo?: string }; -type sendMsgDeleteComplianceInfoParams = { - value: MsgDeleteComplianceInfo, - fee?: StdFee, - memo?: string -}; +type msgUpdateComplianceInfoParams = { + value: MsgUpdateComplianceInfo, +}; -type msgRevokeModelParams = { - value: MsgRevokeModel, +type msgDeleteComplianceInfoParams = { + value: MsgDeleteComplianceInfo, }; type msgCertifyModelParams = { value: MsgCertifyModel, }; -type msgUpdateComplianceInfoParams = { - value: MsgUpdateComplianceInfo, +type msgRevokeModelParams = { + value: MsgRevokeModel, }; type msgProvisionModelParams = { value: MsgProvisionModel, }; -type msgDeleteComplianceInfoParams = { - value: MsgDeleteComplianceInfo, -}; - export const registry = new Registry(msgTypes); @@ -103,17 +103,31 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgRevokeModel({ value, fee, memo }: sendMsgRevokeModelParams): Promise { + async sendMsgUpdateComplianceInfo({ value, fee, memo }: sendMsgUpdateComplianceInfoParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgRevokeModel: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdateComplianceInfo: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgRevokeModel({ value: MsgRevokeModel.fromPartial(value) }) + let msg = this.msgUpdateComplianceInfo({ value: MsgUpdateComplianceInfo.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgRevokeModel: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdateComplianceInfo: Could not broadcast Tx: '+ e.message) + } + }, + + async sendMsgDeleteComplianceInfo({ value, fee, memo }: sendMsgDeleteComplianceInfoParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgDeleteComplianceInfo: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgDeleteComplianceInfo({ value: MsgDeleteComplianceInfo.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgDeleteComplianceInfo: Could not broadcast Tx: '+ e.message) } }, @@ -131,17 +145,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgUpdateComplianceInfo({ value, fee, memo }: sendMsgUpdateComplianceInfoParams): Promise { + async sendMsgRevokeModel({ value, fee, memo }: sendMsgRevokeModelParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdateComplianceInfo: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgRevokeModel: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdateComplianceInfo({ value: MsgUpdateComplianceInfo.fromPartial(value) }) + let msg = this.msgRevokeModel({ value: MsgRevokeModel.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdateComplianceInfo: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgRevokeModel: Could not broadcast Tx: '+ e.message) } }, @@ -159,26 +173,20 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgDeleteComplianceInfo({ value, fee, memo }: sendMsgDeleteComplianceInfoParams): Promise { - if (!signer) { - throw new Error('TxClient:sendMsgDeleteComplianceInfo: Unable to sign Tx. Signer is not present.') - } - try { - const { address } = (await signer.getAccounts())[0]; - const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgDeleteComplianceInfo({ value: MsgDeleteComplianceInfo.fromPartial(value) }) - return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + + msgUpdateComplianceInfo({ value }: msgUpdateComplianceInfoParams): EncodeObject { + try { + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgUpdateComplianceInfo", value: MsgUpdateComplianceInfo.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:sendMsgDeleteComplianceInfo: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgUpdateComplianceInfo: Could not create message: ' + e.message) } }, - - msgRevokeModel({ value }: msgRevokeModelParams): EncodeObject { + msgDeleteComplianceInfo({ value }: msgDeleteComplianceInfoParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgRevokeModel", value: MsgRevokeModel.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgDeleteComplianceInfo", value: MsgDeleteComplianceInfo.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgRevokeModel: Could not create message: ' + e.message) + throw new Error('TxClient:MsgDeleteComplianceInfo: Could not create message: ' + e.message) } }, @@ -190,11 +198,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgUpdateComplianceInfo({ value }: msgUpdateComplianceInfoParams): EncodeObject { + msgRevokeModel({ value }: msgRevokeModelParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgUpdateComplianceInfo", value: MsgUpdateComplianceInfo.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgRevokeModel", value: MsgRevokeModel.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdateComplianceInfo: Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevokeModel: Could not create message: ' + e.message) } }, @@ -206,14 +214,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgDeleteComplianceInfo({ value }: msgDeleteComplianceInfoParams): EncodeObject { - try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.compliance.MsgDeleteComplianceInfo", value: MsgDeleteComplianceInfo.fromPartial( value ) } - } catch (e: any) { - throw new Error('TxClient:MsgDeleteComplianceInfo: Could not create message: ' + e.message) - } - }, - } }; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.compliance/registry.ts b/ts-client/zigbeealliance.distributedcomplianceledger.compliance/registry.ts index 56859a84d..90f9f2dde 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.compliance/registry.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.compliance/registry.ts @@ -1,16 +1,16 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgRevokeModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; -import { MsgCertifyModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; import { MsgUpdateComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; -import { MsgProvisionModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; import { MsgDeleteComplianceInfo } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; +import { MsgCertifyModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; +import { MsgRevokeModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; +import { MsgProvisionModel } from "./types/zigbeealliance/distributedcomplianceledger/compliance/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/zigbeealliance.distributedcomplianceledger.compliance.MsgRevokeModel", MsgRevokeModel], - ["/zigbeealliance.distributedcomplianceledger.compliance.MsgCertifyModel", MsgCertifyModel], ["/zigbeealliance.distributedcomplianceledger.compliance.MsgUpdateComplianceInfo", MsgUpdateComplianceInfo], - ["/zigbeealliance.distributedcomplianceledger.compliance.MsgProvisionModel", MsgProvisionModel], ["/zigbeealliance.distributedcomplianceledger.compliance.MsgDeleteComplianceInfo", MsgDeleteComplianceInfo], + ["/zigbeealliance.distributedcomplianceledger.compliance.MsgCertifyModel", MsgCertifyModel], + ["/zigbeealliance.distributedcomplianceledger.compliance.MsgRevokeModel", MsgRevokeModel], + ["/zigbeealliance.distributedcomplianceledger.compliance.MsgProvisionModel", MsgProvisionModel], ]; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.dclauth/module.ts b/ts-client/zigbeealliance.distributedcomplianceledger.dclauth/module.ts index fc8419731..9f29af06b 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.dclauth/module.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.dclauth/module.ts @@ -7,11 +7,11 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgProposeAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; -import { MsgApproveAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; import { MsgRejectAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; -import { MsgApproveRevokeAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; +import { MsgApproveAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; import { MsgProposeRevokeAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; +import { MsgProposeAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; +import { MsgApproveRevokeAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; import { Account as typeAccount} from "./types" import { AccountStat as typeAccountStat} from "./types" @@ -21,10 +21,10 @@ import { PendingAccountRevocation as typePendingAccountRevocation} from "./types import { RejectedAccount as typeRejectedAccount} from "./types" import { RevokedAccount as typeRevokedAccount} from "./types" -export { MsgProposeAddAccount, MsgApproveAddAccount, MsgRejectAddAccount, MsgApproveRevokeAccount, MsgProposeRevokeAccount }; +export { MsgRejectAddAccount, MsgApproveAddAccount, MsgProposeRevokeAccount, MsgProposeAddAccount, MsgApproveRevokeAccount }; -type sendMsgProposeAddAccountParams = { - value: MsgProposeAddAccount, +type sendMsgRejectAddAccountParams = { + value: MsgRejectAddAccount, fee?: StdFee, memo?: string }; @@ -35,43 +35,43 @@ type sendMsgApproveAddAccountParams = { memo?: string }; -type sendMsgRejectAddAccountParams = { - value: MsgRejectAddAccount, +type sendMsgProposeRevokeAccountParams = { + value: MsgProposeRevokeAccount, fee?: StdFee, memo?: string }; -type sendMsgApproveRevokeAccountParams = { - value: MsgApproveRevokeAccount, +type sendMsgProposeAddAccountParams = { + value: MsgProposeAddAccount, fee?: StdFee, memo?: string }; -type sendMsgProposeRevokeAccountParams = { - value: MsgProposeRevokeAccount, +type sendMsgApproveRevokeAccountParams = { + value: MsgApproveRevokeAccount, fee?: StdFee, memo?: string }; -type msgProposeAddAccountParams = { - value: MsgProposeAddAccount, +type msgRejectAddAccountParams = { + value: MsgRejectAddAccount, }; type msgApproveAddAccountParams = { value: MsgApproveAddAccount, }; -type msgRejectAddAccountParams = { - value: MsgRejectAddAccount, +type msgProposeRevokeAccountParams = { + value: MsgProposeRevokeAccount, }; -type msgApproveRevokeAccountParams = { - value: MsgApproveRevokeAccount, +type msgProposeAddAccountParams = { + value: MsgProposeAddAccount, }; -type msgProposeRevokeAccountParams = { - value: MsgProposeRevokeAccount, +type msgApproveRevokeAccountParams = { + value: MsgApproveRevokeAccount, }; @@ -104,17 +104,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgProposeAddAccount({ value, fee, memo }: sendMsgProposeAddAccountParams): Promise { + async sendMsgRejectAddAccount({ value, fee, memo }: sendMsgRejectAddAccountParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgProposeAddAccount: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgRejectAddAccount: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgProposeAddAccount({ value: MsgProposeAddAccount.fromPartial(value) }) + let msg = this.msgRejectAddAccount({ value: MsgRejectAddAccount.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgProposeAddAccount: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgRejectAddAccount: Could not broadcast Tx: '+ e.message) } }, @@ -132,54 +132,54 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgRejectAddAccount({ value, fee, memo }: sendMsgRejectAddAccountParams): Promise { + async sendMsgProposeRevokeAccount({ value, fee, memo }: sendMsgProposeRevokeAccountParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgRejectAddAccount: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgProposeRevokeAccount: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgRejectAddAccount({ value: MsgRejectAddAccount.fromPartial(value) }) + let msg = this.msgProposeRevokeAccount({ value: MsgProposeRevokeAccount.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgRejectAddAccount: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgProposeRevokeAccount: Could not broadcast Tx: '+ e.message) } }, - async sendMsgApproveRevokeAccount({ value, fee, memo }: sendMsgApproveRevokeAccountParams): Promise { + async sendMsgProposeAddAccount({ value, fee, memo }: sendMsgProposeAddAccountParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgApproveRevokeAccount: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgProposeAddAccount: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgApproveRevokeAccount({ value: MsgApproveRevokeAccount.fromPartial(value) }) + let msg = this.msgProposeAddAccount({ value: MsgProposeAddAccount.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgApproveRevokeAccount: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgProposeAddAccount: Could not broadcast Tx: '+ e.message) } }, - async sendMsgProposeRevokeAccount({ value, fee, memo }: sendMsgProposeRevokeAccountParams): Promise { + async sendMsgApproveRevokeAccount({ value, fee, memo }: sendMsgApproveRevokeAccountParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgProposeRevokeAccount: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgApproveRevokeAccount: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgProposeRevokeAccount({ value: MsgProposeRevokeAccount.fromPartial(value) }) + let msg = this.msgApproveRevokeAccount({ value: MsgApproveRevokeAccount.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgProposeRevokeAccount: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgApproveRevokeAccount: Could not broadcast Tx: '+ e.message) } }, - msgProposeAddAccount({ value }: msgProposeAddAccountParams): EncodeObject { + msgRejectAddAccount({ value }: msgRejectAddAccountParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclauth.MsgProposeAddAccount", value: MsgProposeAddAccount.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclauth.MsgRejectAddAccount", value: MsgRejectAddAccount.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgProposeAddAccount: Could not create message: ' + e.message) + throw new Error('TxClient:MsgRejectAddAccount: Could not create message: ' + e.message) } }, @@ -191,27 +191,27 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgRejectAddAccount({ value }: msgRejectAddAccountParams): EncodeObject { + msgProposeRevokeAccount({ value }: msgProposeRevokeAccountParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclauth.MsgRejectAddAccount", value: MsgRejectAddAccount.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclauth.MsgProposeRevokeAccount", value: MsgProposeRevokeAccount.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgRejectAddAccount: Could not create message: ' + e.message) + throw new Error('TxClient:MsgProposeRevokeAccount: Could not create message: ' + e.message) } }, - msgApproveRevokeAccount({ value }: msgApproveRevokeAccountParams): EncodeObject { + msgProposeAddAccount({ value }: msgProposeAddAccountParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclauth.MsgApproveRevokeAccount", value: MsgApproveRevokeAccount.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclauth.MsgProposeAddAccount", value: MsgProposeAddAccount.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgApproveRevokeAccount: Could not create message: ' + e.message) + throw new Error('TxClient:MsgProposeAddAccount: Could not create message: ' + e.message) } }, - msgProposeRevokeAccount({ value }: msgProposeRevokeAccountParams): EncodeObject { + msgApproveRevokeAccount({ value }: msgApproveRevokeAccountParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclauth.MsgProposeRevokeAccount", value: MsgProposeRevokeAccount.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclauth.MsgApproveRevokeAccount", value: MsgApproveRevokeAccount.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgProposeRevokeAccount: Could not create message: ' + e.message) + throw new Error('TxClient:MsgApproveRevokeAccount: Could not create message: ' + e.message) } }, diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.dclauth/registry.ts b/ts-client/zigbeealliance.distributedcomplianceledger.dclauth/registry.ts index bdc07df48..c31fd08a1 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.dclauth/registry.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.dclauth/registry.ts @@ -1,16 +1,16 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgProposeAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; -import { MsgApproveAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; import { MsgRejectAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; -import { MsgApproveRevokeAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; +import { MsgApproveAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; import { MsgProposeRevokeAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; +import { MsgProposeAddAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; +import { MsgApproveRevokeAccount } from "./types/zigbeealliance/distributedcomplianceledger/dclauth/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/zigbeealliance.distributedcomplianceledger.dclauth.MsgProposeAddAccount", MsgProposeAddAccount], - ["/zigbeealliance.distributedcomplianceledger.dclauth.MsgApproveAddAccount", MsgApproveAddAccount], ["/zigbeealliance.distributedcomplianceledger.dclauth.MsgRejectAddAccount", MsgRejectAddAccount], - ["/zigbeealliance.distributedcomplianceledger.dclauth.MsgApproveRevokeAccount", MsgApproveRevokeAccount], + ["/zigbeealliance.distributedcomplianceledger.dclauth.MsgApproveAddAccount", MsgApproveAddAccount], ["/zigbeealliance.distributedcomplianceledger.dclauth.MsgProposeRevokeAccount", MsgProposeRevokeAccount], + ["/zigbeealliance.distributedcomplianceledger.dclauth.MsgProposeAddAccount", MsgProposeAddAccount], + ["/zigbeealliance.distributedcomplianceledger.dclauth.MsgApproveRevokeAccount", MsgApproveRevokeAccount], ]; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.dclupgrade/module.ts b/ts-client/zigbeealliance.distributedcomplianceledger.dclupgrade/module.ts index c66dbc0d4..25b3f313e 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.dclupgrade/module.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.dclupgrade/module.ts @@ -7,22 +7,16 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgApproveUpgrade } from "./types/zigbeealliance/distributedcomplianceledger/dclupgrade/tx"; import { MsgProposeUpgrade } from "./types/zigbeealliance/distributedcomplianceledger/dclupgrade/tx"; import { MsgRejectUpgrade } from "./types/zigbeealliance/distributedcomplianceledger/dclupgrade/tx"; +import { MsgApproveUpgrade } from "./types/zigbeealliance/distributedcomplianceledger/dclupgrade/tx"; import { ApprovedUpgrade as typeApprovedUpgrade} from "./types" import { Grant as typeGrant} from "./types" import { ProposedUpgrade as typeProposedUpgrade} from "./types" import { RejectedUpgrade as typeRejectedUpgrade} from "./types" -export { MsgApproveUpgrade, MsgProposeUpgrade, MsgRejectUpgrade }; - -type sendMsgApproveUpgradeParams = { - value: MsgApproveUpgrade, - fee?: StdFee, - memo?: string -}; +export { MsgProposeUpgrade, MsgRejectUpgrade, MsgApproveUpgrade }; type sendMsgProposeUpgradeParams = { value: MsgProposeUpgrade, @@ -36,11 +30,13 @@ type sendMsgRejectUpgradeParams = { memo?: string }; - -type msgApproveUpgradeParams = { +type sendMsgApproveUpgradeParams = { value: MsgApproveUpgrade, + fee?: StdFee, + memo?: string }; + type msgProposeUpgradeParams = { value: MsgProposeUpgrade, }; @@ -49,6 +45,10 @@ type msgRejectUpgradeParams = { value: MsgRejectUpgrade, }; +type msgApproveUpgradeParams = { + value: MsgApproveUpgrade, +}; + export const registry = new Registry(msgTypes); @@ -79,20 +79,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgApproveUpgrade({ value, fee, memo }: sendMsgApproveUpgradeParams): Promise { - if (!signer) { - throw new Error('TxClient:sendMsgApproveUpgrade: Unable to sign Tx. Signer is not present.') - } - try { - const { address } = (await signer.getAccounts())[0]; - const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgApproveUpgrade({ value: MsgApproveUpgrade.fromPartial(value) }) - return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) - } catch (e: any) { - throw new Error('TxClient:sendMsgApproveUpgrade: Could not broadcast Tx: '+ e.message) - } - }, - async sendMsgProposeUpgrade({ value, fee, memo }: sendMsgProposeUpgradeParams): Promise { if (!signer) { throw new Error('TxClient:sendMsgProposeUpgrade: Unable to sign Tx. Signer is not present.') @@ -121,15 +107,21 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - - msgApproveUpgrade({ value }: msgApproveUpgradeParams): EncodeObject { - try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclupgrade.MsgApproveUpgrade", value: MsgApproveUpgrade.fromPartial( value ) } + async sendMsgApproveUpgrade({ value, fee, memo }: sendMsgApproveUpgradeParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgApproveUpgrade: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgApproveUpgrade({ value: MsgApproveUpgrade.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:MsgApproveUpgrade: Could not create message: ' + e.message) + throw new Error('TxClient:sendMsgApproveUpgrade: Could not broadcast Tx: '+ e.message) } }, + msgProposeUpgrade({ value }: msgProposeUpgradeParams): EncodeObject { try { return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclupgrade.MsgProposeUpgrade", value: MsgProposeUpgrade.fromPartial( value ) } @@ -146,6 +138,14 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, + msgApproveUpgrade({ value }: msgApproveUpgradeParams): EncodeObject { + try { + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.dclupgrade.MsgApproveUpgrade", value: MsgApproveUpgrade.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgApproveUpgrade: Could not create message: ' + e.message) + } + }, + } }; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.dclupgrade/registry.ts b/ts-client/zigbeealliance.distributedcomplianceledger.dclupgrade/registry.ts index e81fcdafd..6801e0072 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.dclupgrade/registry.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.dclupgrade/registry.ts @@ -1,12 +1,12 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgApproveUpgrade } from "./types/zigbeealliance/distributedcomplianceledger/dclupgrade/tx"; import { MsgProposeUpgrade } from "./types/zigbeealliance/distributedcomplianceledger/dclupgrade/tx"; import { MsgRejectUpgrade } from "./types/zigbeealliance/distributedcomplianceledger/dclupgrade/tx"; +import { MsgApproveUpgrade } from "./types/zigbeealliance/distributedcomplianceledger/dclupgrade/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/zigbeealliance.distributedcomplianceledger.dclupgrade.MsgApproveUpgrade", MsgApproveUpgrade], ["/zigbeealliance.distributedcomplianceledger.dclupgrade.MsgProposeUpgrade", MsgProposeUpgrade], ["/zigbeealliance.distributedcomplianceledger.dclupgrade.MsgRejectUpgrade", MsgRejectUpgrade], + ["/zigbeealliance.distributedcomplianceledger.dclupgrade.MsgApproveUpgrade", MsgApproveUpgrade], ]; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.model/module.ts b/ts-client/zigbeealliance.distributedcomplianceledger.model/module.ts index 385173dea..39b4a0b9a 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.model/module.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.model/module.ts @@ -7,12 +7,12 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; +import { MsgUpdateModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; import { MsgCreateModel } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; +import { MsgDeleteModel } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; +import { MsgCreateModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; import { MsgUpdateModel } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; import { MsgDeleteModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; -import { MsgCreateModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; -import { MsgUpdateModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; -import { MsgDeleteModel } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; import { Model as typeModel} from "./types" import { ModelVersion as typeModelVersion} from "./types" @@ -20,22 +20,22 @@ import { ModelVersions as typeModelVersions} from "./types" import { Product as typeProduct} from "./types" import { VendorProducts as typeVendorProducts} from "./types" -export { MsgCreateModel, MsgUpdateModel, MsgDeleteModelVersion, MsgCreateModelVersion, MsgUpdateModelVersion, MsgDeleteModel }; +export { MsgUpdateModelVersion, MsgCreateModel, MsgDeleteModel, MsgCreateModelVersion, MsgUpdateModel, MsgDeleteModelVersion }; -type sendMsgCreateModelParams = { - value: MsgCreateModel, +type sendMsgUpdateModelVersionParams = { + value: MsgUpdateModelVersion, fee?: StdFee, memo?: string }; -type sendMsgUpdateModelParams = { - value: MsgUpdateModel, +type sendMsgCreateModelParams = { + value: MsgCreateModel, fee?: StdFee, memo?: string }; -type sendMsgDeleteModelVersionParams = { - value: MsgDeleteModelVersion, +type sendMsgDeleteModelParams = { + value: MsgDeleteModel, fee?: StdFee, memo?: string }; @@ -46,41 +46,41 @@ type sendMsgCreateModelVersionParams = { memo?: string }; -type sendMsgUpdateModelVersionParams = { - value: MsgUpdateModelVersion, +type sendMsgUpdateModelParams = { + value: MsgUpdateModel, fee?: StdFee, memo?: string }; -type sendMsgDeleteModelParams = { - value: MsgDeleteModel, +type sendMsgDeleteModelVersionParams = { + value: MsgDeleteModelVersion, fee?: StdFee, memo?: string }; -type msgCreateModelParams = { - value: MsgCreateModel, +type msgUpdateModelVersionParams = { + value: MsgUpdateModelVersion, }; -type msgUpdateModelParams = { - value: MsgUpdateModel, +type msgCreateModelParams = { + value: MsgCreateModel, }; -type msgDeleteModelVersionParams = { - value: MsgDeleteModelVersion, +type msgDeleteModelParams = { + value: MsgDeleteModel, }; type msgCreateModelVersionParams = { value: MsgCreateModelVersion, }; -type msgUpdateModelVersionParams = { - value: MsgUpdateModelVersion, +type msgUpdateModelParams = { + value: MsgUpdateModel, }; -type msgDeleteModelParams = { - value: MsgDeleteModel, +type msgDeleteModelVersionParams = { + value: MsgDeleteModelVersion, }; @@ -113,45 +113,45 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgCreateModel({ value, fee, memo }: sendMsgCreateModelParams): Promise { + async sendMsgUpdateModelVersion({ value, fee, memo }: sendMsgUpdateModelVersionParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgCreateModel: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdateModelVersion: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgCreateModel({ value: MsgCreateModel.fromPartial(value) }) + let msg = this.msgUpdateModelVersion({ value: MsgUpdateModelVersion.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgCreateModel: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdateModelVersion: Could not broadcast Tx: '+ e.message) } }, - async sendMsgUpdateModel({ value, fee, memo }: sendMsgUpdateModelParams): Promise { + async sendMsgCreateModel({ value, fee, memo }: sendMsgCreateModelParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdateModel: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgCreateModel: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdateModel({ value: MsgUpdateModel.fromPartial(value) }) + let msg = this.msgCreateModel({ value: MsgCreateModel.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdateModel: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgCreateModel: Could not broadcast Tx: '+ e.message) } }, - async sendMsgDeleteModelVersion({ value, fee, memo }: sendMsgDeleteModelVersionParams): Promise { + async sendMsgDeleteModel({ value, fee, memo }: sendMsgDeleteModelParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgDeleteModelVersion: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgDeleteModel: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgDeleteModelVersion({ value: MsgDeleteModelVersion.fromPartial(value) }) + let msg = this.msgDeleteModel({ value: MsgDeleteModel.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgDeleteModelVersion: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgDeleteModel: Could not broadcast Tx: '+ e.message) } }, @@ -169,56 +169,56 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgUpdateModelVersion({ value, fee, memo }: sendMsgUpdateModelVersionParams): Promise { + async sendMsgUpdateModel({ value, fee, memo }: sendMsgUpdateModelParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdateModelVersion: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdateModel: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdateModelVersion({ value: MsgUpdateModelVersion.fromPartial(value) }) + let msg = this.msgUpdateModel({ value: MsgUpdateModel.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdateModelVersion: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdateModel: Could not broadcast Tx: '+ e.message) } }, - async sendMsgDeleteModel({ value, fee, memo }: sendMsgDeleteModelParams): Promise { + async sendMsgDeleteModelVersion({ value, fee, memo }: sendMsgDeleteModelVersionParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgDeleteModel: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgDeleteModelVersion: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgDeleteModel({ value: MsgDeleteModel.fromPartial(value) }) + let msg = this.msgDeleteModelVersion({ value: MsgDeleteModelVersion.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgDeleteModel: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgDeleteModelVersion: Could not broadcast Tx: '+ e.message) } }, - msgCreateModel({ value }: msgCreateModelParams): EncodeObject { + msgUpdateModelVersion({ value }: msgUpdateModelVersionParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgCreateModel", value: MsgCreateModel.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgUpdateModelVersion", value: MsgUpdateModelVersion.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgCreateModel: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUpdateModelVersion: Could not create message: ' + e.message) } }, - msgUpdateModel({ value }: msgUpdateModelParams): EncodeObject { + msgCreateModel({ value }: msgCreateModelParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgUpdateModel", value: MsgUpdateModel.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgCreateModel", value: MsgCreateModel.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdateModel: Could not create message: ' + e.message) + throw new Error('TxClient:MsgCreateModel: Could not create message: ' + e.message) } }, - msgDeleteModelVersion({ value }: msgDeleteModelVersionParams): EncodeObject { + msgDeleteModel({ value }: msgDeleteModelParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgDeleteModelVersion", value: MsgDeleteModelVersion.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgDeleteModel", value: MsgDeleteModel.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgDeleteModelVersion: Could not create message: ' + e.message) + throw new Error('TxClient:MsgDeleteModel: Could not create message: ' + e.message) } }, @@ -230,19 +230,19 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgUpdateModelVersion({ value }: msgUpdateModelVersionParams): EncodeObject { + msgUpdateModel({ value }: msgUpdateModelParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgUpdateModelVersion", value: MsgUpdateModelVersion.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgUpdateModel", value: MsgUpdateModel.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdateModelVersion: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUpdateModel: Could not create message: ' + e.message) } }, - msgDeleteModel({ value }: msgDeleteModelParams): EncodeObject { + msgDeleteModelVersion({ value }: msgDeleteModelVersionParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgDeleteModel", value: MsgDeleteModel.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.model.MsgDeleteModelVersion", value: MsgDeleteModelVersion.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgDeleteModel: Could not create message: ' + e.message) + throw new Error('TxClient:MsgDeleteModelVersion: Could not create message: ' + e.message) } }, diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.model/registry.ts b/ts-client/zigbeealliance.distributedcomplianceledger.model/registry.ts index 8537d5bfb..c27284e75 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.model/registry.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.model/registry.ts @@ -1,18 +1,18 @@ import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgUpdateModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; import { MsgCreateModel } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; +import { MsgDeleteModel } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; +import { MsgCreateModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; import { MsgUpdateModel } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; import { MsgDeleteModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; -import { MsgCreateModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; -import { MsgUpdateModelVersion } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; -import { MsgDeleteModel } from "./types/zigbeealliance/distributedcomplianceledger/model/tx"; const msgTypes: Array<[string, GeneratedType]> = [ + ["/zigbeealliance.distributedcomplianceledger.model.MsgUpdateModelVersion", MsgUpdateModelVersion], ["/zigbeealliance.distributedcomplianceledger.model.MsgCreateModel", MsgCreateModel], + ["/zigbeealliance.distributedcomplianceledger.model.MsgDeleteModel", MsgDeleteModel], + ["/zigbeealliance.distributedcomplianceledger.model.MsgCreateModelVersion", MsgCreateModelVersion], ["/zigbeealliance.distributedcomplianceledger.model.MsgUpdateModel", MsgUpdateModel], ["/zigbeealliance.distributedcomplianceledger.model.MsgDeleteModelVersion", MsgDeleteModelVersion], - ["/zigbeealliance.distributedcomplianceledger.model.MsgCreateModelVersion", MsgCreateModelVersion], - ["/zigbeealliance.distributedcomplianceledger.model.MsgUpdateModelVersion", MsgUpdateModelVersion], - ["/zigbeealliance.distributedcomplianceledger.model.MsgDeleteModel", MsgDeleteModel], ]; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.model/rest.ts b/ts-client/zigbeealliance.distributedcomplianceledger.model/rest.ts index e074fd071..e067585aa 100644 --- a/ts-client/zigbeealliance.distributedcomplianceledger.model/rest.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.model/rest.ts @@ -44,7 +44,6 @@ export interface DistributedcomplianceledgermodelModel { /** @format int64 */ schemaVersion?: number; - managedAclExtensionRequestFlowUrl?: string; /** @format int32 */ enhancedSetupFlowOptions?: number; @@ -57,6 +56,10 @@ export interface DistributedcomplianceledgermodelModel { /** @format int64 */ enhancedSetupFlowTCFileSize?: number; maintenanceUrl?: string; + + /** @format int64 */ + discoveryCapabilitiesBitmask?: number; + commissioningFallbackUrl?: string; } export interface DistributedcomplianceledgermodelModelVersion { diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.model/types/zigbeealliance/distributedcomplianceledger/model/model.ts b/ts-client/zigbeealliance.distributedcomplianceledger.model/types/zigbeealliance/distributedcomplianceledger/model/model.ts index 5abc40b0e..546bce778 100644 --- a/ts-client/zigbeealliance.distributedcomplianceledger.model/types/zigbeealliance/distributedcomplianceledger/model/model.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.model/types/zigbeealliance/distributedcomplianceledger/model/model.ts @@ -23,13 +23,14 @@ export interface Model { lsfRevision: number; creator: string; schemaVersion: number; - managedAclExtensionRequestFlowUrl: string; enhancedSetupFlowOptions: number; enhancedSetupFlowTCUrl: string; enhancedSetupFlowTCRevision: number; enhancedSetupFlowTCDigest: string; enhancedSetupFlowTCFileSize: number; maintenanceUrl: string; + discoveryCapabilitiesBitmask: number; + commissioningFallbackUrl: string; } function createBaseModel(): Model { @@ -53,13 +54,14 @@ function createBaseModel(): Model { lsfRevision: 0, creator: "", schemaVersion: 0, - managedAclExtensionRequestFlowUrl: "", enhancedSetupFlowOptions: 0, enhancedSetupFlowTCUrl: "", enhancedSetupFlowTCRevision: 0, enhancedSetupFlowTCDigest: "", enhancedSetupFlowTCFileSize: 0, maintenanceUrl: "", + discoveryCapabilitiesBitmask: 0, + commissioningFallbackUrl: "", }; } @@ -122,26 +124,29 @@ export const Model = { if (message.schemaVersion !== 0) { writer.uint32(152).uint32(message.schemaVersion); } - if (message.managedAclExtensionRequestFlowUrl !== "") { - writer.uint32(162).string(message.managedAclExtensionRequestFlowUrl); - } if (message.enhancedSetupFlowOptions !== 0) { - writer.uint32(168).int32(message.enhancedSetupFlowOptions); + writer.uint32(160).int32(message.enhancedSetupFlowOptions); } if (message.enhancedSetupFlowTCUrl !== "") { - writer.uint32(178).string(message.enhancedSetupFlowTCUrl); + writer.uint32(170).string(message.enhancedSetupFlowTCUrl); } if (message.enhancedSetupFlowTCRevision !== 0) { - writer.uint32(184).int32(message.enhancedSetupFlowTCRevision); + writer.uint32(176).int32(message.enhancedSetupFlowTCRevision); } if (message.enhancedSetupFlowTCDigest !== "") { - writer.uint32(194).string(message.enhancedSetupFlowTCDigest); + writer.uint32(186).string(message.enhancedSetupFlowTCDigest); } if (message.enhancedSetupFlowTCFileSize !== 0) { - writer.uint32(200).uint32(message.enhancedSetupFlowTCFileSize); + writer.uint32(192).uint32(message.enhancedSetupFlowTCFileSize); } if (message.maintenanceUrl !== "") { - writer.uint32(210).string(message.maintenanceUrl); + writer.uint32(202).string(message.maintenanceUrl); + } + if (message.discoveryCapabilitiesBitmask !== 0) { + writer.uint32(208).uint32(message.discoveryCapabilitiesBitmask); + } + if (message.commissioningFallbackUrl !== "") { + writer.uint32(218).string(message.commissioningFallbackUrl); } return writer; }, @@ -211,25 +216,28 @@ export const Model = { message.schemaVersion = reader.uint32(); break; case 20: - message.managedAclExtensionRequestFlowUrl = reader.string(); + message.enhancedSetupFlowOptions = reader.int32(); break; case 21: - message.enhancedSetupFlowOptions = reader.int32(); + message.enhancedSetupFlowTCUrl = reader.string(); break; case 22: - message.enhancedSetupFlowTCUrl = reader.string(); + message.enhancedSetupFlowTCRevision = reader.int32(); break; case 23: - message.enhancedSetupFlowTCRevision = reader.int32(); + message.enhancedSetupFlowTCDigest = reader.string(); break; case 24: - message.enhancedSetupFlowTCDigest = reader.string(); + message.enhancedSetupFlowTCFileSize = reader.uint32(); break; case 25: - message.enhancedSetupFlowTCFileSize = reader.uint32(); + message.maintenanceUrl = reader.string(); break; case 26: - message.maintenanceUrl = reader.string(); + message.discoveryCapabilitiesBitmask = reader.uint32(); + break; + case 27: + message.commissioningFallbackUrl = reader.string(); break; default: reader.skipType(tag & 7); @@ -270,9 +278,6 @@ export const Model = { lsfRevision: isSet(object.lsfRevision) ? Number(object.lsfRevision) : 0, creator: isSet(object.creator) ? String(object.creator) : "", schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, - managedAclExtensionRequestFlowUrl: isSet(object.managedAclExtensionRequestFlowUrl) - ? String(object.managedAclExtensionRequestFlowUrl) - : "", enhancedSetupFlowOptions: isSet(object.enhancedSetupFlowOptions) ? Number(object.enhancedSetupFlowOptions) : 0, enhancedSetupFlowTCUrl: isSet(object.enhancedSetupFlowTCUrl) ? String(object.enhancedSetupFlowTCUrl) : "", enhancedSetupFlowTCRevision: isSet(object.enhancedSetupFlowTCRevision) @@ -285,6 +290,10 @@ export const Model = { ? Number(object.enhancedSetupFlowTCFileSize) : 0, maintenanceUrl: isSet(object.maintenanceUrl) ? String(object.maintenanceUrl) : "", + discoveryCapabilitiesBitmask: isSet(object.discoveryCapabilitiesBitmask) + ? Number(object.discoveryCapabilitiesBitmask) + : 0, + commissioningFallbackUrl: isSet(object.commissioningFallbackUrl) ? String(object.commissioningFallbackUrl) : "", }; }, @@ -315,8 +324,6 @@ export const Model = { message.lsfRevision !== undefined && (obj.lsfRevision = Math.round(message.lsfRevision)); message.creator !== undefined && (obj.creator = message.creator); message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); - message.managedAclExtensionRequestFlowUrl !== undefined - && (obj.managedAclExtensionRequestFlowUrl = message.managedAclExtensionRequestFlowUrl); message.enhancedSetupFlowOptions !== undefined && (obj.enhancedSetupFlowOptions = Math.round(message.enhancedSetupFlowOptions)); message.enhancedSetupFlowTCUrl !== undefined && (obj.enhancedSetupFlowTCUrl = message.enhancedSetupFlowTCUrl); @@ -327,6 +334,9 @@ export const Model = { message.enhancedSetupFlowTCFileSize !== undefined && (obj.enhancedSetupFlowTCFileSize = Math.round(message.enhancedSetupFlowTCFileSize)); message.maintenanceUrl !== undefined && (obj.maintenanceUrl = message.maintenanceUrl); + message.discoveryCapabilitiesBitmask !== undefined + && (obj.discoveryCapabilitiesBitmask = Math.round(message.discoveryCapabilitiesBitmask)); + message.commissioningFallbackUrl !== undefined && (obj.commissioningFallbackUrl = message.commissioningFallbackUrl); return obj; }, @@ -351,13 +361,14 @@ export const Model = { message.lsfRevision = object.lsfRevision ?? 0; message.creator = object.creator ?? ""; message.schemaVersion = object.schemaVersion ?? 0; - message.managedAclExtensionRequestFlowUrl = object.managedAclExtensionRequestFlowUrl ?? ""; message.enhancedSetupFlowOptions = object.enhancedSetupFlowOptions ?? 0; message.enhancedSetupFlowTCUrl = object.enhancedSetupFlowTCUrl ?? ""; message.enhancedSetupFlowTCRevision = object.enhancedSetupFlowTCRevision ?? 0; message.enhancedSetupFlowTCDigest = object.enhancedSetupFlowTCDigest ?? ""; message.enhancedSetupFlowTCFileSize = object.enhancedSetupFlowTCFileSize ?? 0; message.maintenanceUrl = object.maintenanceUrl ?? ""; + message.discoveryCapabilitiesBitmask = object.discoveryCapabilitiesBitmask ?? 0; + message.commissioningFallbackUrl = object.commissioningFallbackUrl ?? ""; return message; }, }; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.model/types/zigbeealliance/distributedcomplianceledger/model/tx.ts b/ts-client/zigbeealliance.distributedcomplianceledger.model/types/zigbeealliance/distributedcomplianceledger/model/tx.ts index 2cd165be8..8e1758ca9 100644 --- a/ts-client/zigbeealliance.distributedcomplianceledger.model/types/zigbeealliance/distributedcomplianceledger/model/tx.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.model/types/zigbeealliance/distributedcomplianceledger/model/tx.ts @@ -23,13 +23,14 @@ export interface MsgCreateModel { productUrl: string; lsfUrl: string; schemaVersion: number; - managedAclExtensionRequestFlowUrl: string; enhancedSetupFlowOptions: number; enhancedSetupFlowTCUrl: string; enhancedSetupFlowTCRevision: number; enhancedSetupFlowTCDigest: string; enhancedSetupFlowTCFileSize: number; maintenanceUrl: string; + discoveryCapabilitiesBitmask: number; + commissioningFallbackUrl: string; } export interface MsgCreateModelResponse { @@ -51,7 +52,6 @@ export interface MsgUpdateModel { lsfUrl: string; lsfRevision: number; schemaVersion: number; - managedAclExtensionRequestFlowUrl: string; commissioningModeInitialStepsHint: number; enhancedSetupFlowOptions: number; enhancedSetupFlowTCUrl: string; @@ -59,6 +59,7 @@ export interface MsgUpdateModel { enhancedSetupFlowTCDigest: string; enhancedSetupFlowTCFileSize: number; maintenanceUrl: string; + commissioningFallbackUrl: string; } export interface MsgUpdateModelResponse { @@ -143,13 +144,14 @@ function createBaseMsgCreateModel(): MsgCreateModel { productUrl: "", lsfUrl: "", schemaVersion: 0, - managedAclExtensionRequestFlowUrl: "", enhancedSetupFlowOptions: 0, enhancedSetupFlowTCUrl: "", enhancedSetupFlowTCRevision: 0, enhancedSetupFlowTCDigest: "", enhancedSetupFlowTCFileSize: 0, maintenanceUrl: "", + discoveryCapabilitiesBitmask: 0, + commissioningFallbackUrl: "", }; } @@ -209,26 +211,29 @@ export const MsgCreateModel = { if (message.schemaVersion !== 0) { writer.uint32(144).uint32(message.schemaVersion); } - if (message.managedAclExtensionRequestFlowUrl !== "") { - writer.uint32(154).string(message.managedAclExtensionRequestFlowUrl); - } if (message.enhancedSetupFlowOptions !== 0) { - writer.uint32(160).int32(message.enhancedSetupFlowOptions); + writer.uint32(152).int32(message.enhancedSetupFlowOptions); } if (message.enhancedSetupFlowTCUrl !== "") { - writer.uint32(170).string(message.enhancedSetupFlowTCUrl); + writer.uint32(162).string(message.enhancedSetupFlowTCUrl); } if (message.enhancedSetupFlowTCRevision !== 0) { - writer.uint32(176).int32(message.enhancedSetupFlowTCRevision); + writer.uint32(168).int32(message.enhancedSetupFlowTCRevision); } if (message.enhancedSetupFlowTCDigest !== "") { - writer.uint32(186).string(message.enhancedSetupFlowTCDigest); + writer.uint32(178).string(message.enhancedSetupFlowTCDigest); } if (message.enhancedSetupFlowTCFileSize !== 0) { - writer.uint32(192).uint32(message.enhancedSetupFlowTCFileSize); + writer.uint32(184).uint32(message.enhancedSetupFlowTCFileSize); } if (message.maintenanceUrl !== "") { - writer.uint32(202).string(message.maintenanceUrl); + writer.uint32(194).string(message.maintenanceUrl); + } + if (message.discoveryCapabilitiesBitmask !== 0) { + writer.uint32(200).uint32(message.discoveryCapabilitiesBitmask); + } + if (message.commissioningFallbackUrl !== "") { + writer.uint32(210).string(message.commissioningFallbackUrl); } return writer; }, @@ -295,25 +300,28 @@ export const MsgCreateModel = { message.schemaVersion = reader.uint32(); break; case 19: - message.managedAclExtensionRequestFlowUrl = reader.string(); + message.enhancedSetupFlowOptions = reader.int32(); break; case 20: - message.enhancedSetupFlowOptions = reader.int32(); + message.enhancedSetupFlowTCUrl = reader.string(); break; case 21: - message.enhancedSetupFlowTCUrl = reader.string(); + message.enhancedSetupFlowTCRevision = reader.int32(); break; case 22: - message.enhancedSetupFlowTCRevision = reader.int32(); + message.enhancedSetupFlowTCDigest = reader.string(); break; case 23: - message.enhancedSetupFlowTCDigest = reader.string(); + message.enhancedSetupFlowTCFileSize = reader.uint32(); break; case 24: - message.enhancedSetupFlowTCFileSize = reader.uint32(); + message.maintenanceUrl = reader.string(); break; case 25: - message.maintenanceUrl = reader.string(); + message.discoveryCapabilitiesBitmask = reader.uint32(); + break; + case 26: + message.commissioningFallbackUrl = reader.string(); break; default: reader.skipType(tag & 7); @@ -353,9 +361,6 @@ export const MsgCreateModel = { productUrl: isSet(object.productUrl) ? String(object.productUrl) : "", lsfUrl: isSet(object.lsfUrl) ? String(object.lsfUrl) : "", schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, - managedAclExtensionRequestFlowUrl: isSet(object.managedAclExtensionRequestFlowUrl) - ? String(object.managedAclExtensionRequestFlowUrl) - : "", enhancedSetupFlowOptions: isSet(object.enhancedSetupFlowOptions) ? Number(object.enhancedSetupFlowOptions) : 0, enhancedSetupFlowTCUrl: isSet(object.enhancedSetupFlowTCUrl) ? String(object.enhancedSetupFlowTCUrl) : "", enhancedSetupFlowTCRevision: isSet(object.enhancedSetupFlowTCRevision) @@ -368,6 +373,10 @@ export const MsgCreateModel = { ? Number(object.enhancedSetupFlowTCFileSize) : 0, maintenanceUrl: isSet(object.maintenanceUrl) ? String(object.maintenanceUrl) : "", + discoveryCapabilitiesBitmask: isSet(object.discoveryCapabilitiesBitmask) + ? Number(object.discoveryCapabilitiesBitmask) + : 0, + commissioningFallbackUrl: isSet(object.commissioningFallbackUrl) ? String(object.commissioningFallbackUrl) : "", }; }, @@ -397,8 +406,6 @@ export const MsgCreateModel = { message.productUrl !== undefined && (obj.productUrl = message.productUrl); message.lsfUrl !== undefined && (obj.lsfUrl = message.lsfUrl); message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); - message.managedAclExtensionRequestFlowUrl !== undefined - && (obj.managedAclExtensionRequestFlowUrl = message.managedAclExtensionRequestFlowUrl); message.enhancedSetupFlowOptions !== undefined && (obj.enhancedSetupFlowOptions = Math.round(message.enhancedSetupFlowOptions)); message.enhancedSetupFlowTCUrl !== undefined && (obj.enhancedSetupFlowTCUrl = message.enhancedSetupFlowTCUrl); @@ -409,6 +416,9 @@ export const MsgCreateModel = { message.enhancedSetupFlowTCFileSize !== undefined && (obj.enhancedSetupFlowTCFileSize = Math.round(message.enhancedSetupFlowTCFileSize)); message.maintenanceUrl !== undefined && (obj.maintenanceUrl = message.maintenanceUrl); + message.discoveryCapabilitiesBitmask !== undefined + && (obj.discoveryCapabilitiesBitmask = Math.round(message.discoveryCapabilitiesBitmask)); + message.commissioningFallbackUrl !== undefined && (obj.commissioningFallbackUrl = message.commissioningFallbackUrl); return obj; }, @@ -432,13 +442,14 @@ export const MsgCreateModel = { message.productUrl = object.productUrl ?? ""; message.lsfUrl = object.lsfUrl ?? ""; message.schemaVersion = object.schemaVersion ?? 0; - message.managedAclExtensionRequestFlowUrl = object.managedAclExtensionRequestFlowUrl ?? ""; message.enhancedSetupFlowOptions = object.enhancedSetupFlowOptions ?? 0; message.enhancedSetupFlowTCUrl = object.enhancedSetupFlowTCUrl ?? ""; message.enhancedSetupFlowTCRevision = object.enhancedSetupFlowTCRevision ?? 0; message.enhancedSetupFlowTCDigest = object.enhancedSetupFlowTCDigest ?? ""; message.enhancedSetupFlowTCFileSize = object.enhancedSetupFlowTCFileSize ?? 0; message.maintenanceUrl = object.maintenanceUrl ?? ""; + message.discoveryCapabilitiesBitmask = object.discoveryCapabilitiesBitmask ?? 0; + message.commissioningFallbackUrl = object.commissioningFallbackUrl ?? ""; return message; }, }; @@ -499,7 +510,6 @@ function createBaseMsgUpdateModel(): MsgUpdateModel { lsfUrl: "", lsfRevision: 0, schemaVersion: 0, - managedAclExtensionRequestFlowUrl: "", commissioningModeInitialStepsHint: 0, enhancedSetupFlowOptions: 0, enhancedSetupFlowTCUrl: "", @@ -507,6 +517,7 @@ function createBaseMsgUpdateModel(): MsgUpdateModel { enhancedSetupFlowTCDigest: "", enhancedSetupFlowTCFileSize: 0, maintenanceUrl: "", + commissioningFallbackUrl: "", }; } @@ -557,29 +568,29 @@ export const MsgUpdateModel = { if (message.schemaVersion !== 0) { writer.uint32(120).uint32(message.schemaVersion); } - if (message.managedAclExtensionRequestFlowUrl !== "") { - writer.uint32(130).string(message.managedAclExtensionRequestFlowUrl); - } if (message.commissioningModeInitialStepsHint !== 0) { - writer.uint32(136).uint32(message.commissioningModeInitialStepsHint); + writer.uint32(128).uint32(message.commissioningModeInitialStepsHint); } if (message.enhancedSetupFlowOptions !== 0) { - writer.uint32(144).int32(message.enhancedSetupFlowOptions); + writer.uint32(136).int32(message.enhancedSetupFlowOptions); } if (message.enhancedSetupFlowTCUrl !== "") { - writer.uint32(154).string(message.enhancedSetupFlowTCUrl); + writer.uint32(146).string(message.enhancedSetupFlowTCUrl); } if (message.enhancedSetupFlowTCRevision !== 0) { - writer.uint32(160).int32(message.enhancedSetupFlowTCRevision); + writer.uint32(152).int32(message.enhancedSetupFlowTCRevision); } if (message.enhancedSetupFlowTCDigest !== "") { - writer.uint32(170).string(message.enhancedSetupFlowTCDigest); + writer.uint32(162).string(message.enhancedSetupFlowTCDigest); } if (message.enhancedSetupFlowTCFileSize !== 0) { - writer.uint32(176).uint32(message.enhancedSetupFlowTCFileSize); + writer.uint32(168).uint32(message.enhancedSetupFlowTCFileSize); } if (message.maintenanceUrl !== "") { - writer.uint32(186).string(message.maintenanceUrl); + writer.uint32(178).string(message.maintenanceUrl); + } + if (message.commissioningFallbackUrl !== "") { + writer.uint32(186).string(message.commissioningFallbackUrl); } return writer; }, @@ -637,28 +648,28 @@ export const MsgUpdateModel = { message.schemaVersion = reader.uint32(); break; case 16: - message.managedAclExtensionRequestFlowUrl = reader.string(); + message.commissioningModeInitialStepsHint = reader.uint32(); break; case 17: - message.commissioningModeInitialStepsHint = reader.uint32(); + message.enhancedSetupFlowOptions = reader.int32(); break; case 18: - message.enhancedSetupFlowOptions = reader.int32(); + message.enhancedSetupFlowTCUrl = reader.string(); break; case 19: - message.enhancedSetupFlowTCUrl = reader.string(); + message.enhancedSetupFlowTCRevision = reader.int32(); break; case 20: - message.enhancedSetupFlowTCRevision = reader.int32(); + message.enhancedSetupFlowTCDigest = reader.string(); break; case 21: - message.enhancedSetupFlowTCDigest = reader.string(); + message.enhancedSetupFlowTCFileSize = reader.uint32(); break; case 22: - message.enhancedSetupFlowTCFileSize = reader.uint32(); + message.maintenanceUrl = reader.string(); break; case 23: - message.maintenanceUrl = reader.string(); + message.commissioningFallbackUrl = reader.string(); break; default: reader.skipType(tag & 7); @@ -691,9 +702,6 @@ export const MsgUpdateModel = { lsfUrl: isSet(object.lsfUrl) ? String(object.lsfUrl) : "", lsfRevision: isSet(object.lsfRevision) ? Number(object.lsfRevision) : 0, schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, - managedAclExtensionRequestFlowUrl: isSet(object.managedAclExtensionRequestFlowUrl) - ? String(object.managedAclExtensionRequestFlowUrl) - : "", commissioningModeInitialStepsHint: isSet(object.commissioningModeInitialStepsHint) ? Number(object.commissioningModeInitialStepsHint) : 0, @@ -709,6 +717,7 @@ export const MsgUpdateModel = { ? Number(object.enhancedSetupFlowTCFileSize) : 0, maintenanceUrl: isSet(object.maintenanceUrl) ? String(object.maintenanceUrl) : "", + commissioningFallbackUrl: isSet(object.commissioningFallbackUrl) ? String(object.commissioningFallbackUrl) : "", }; }, @@ -732,8 +741,6 @@ export const MsgUpdateModel = { message.lsfUrl !== undefined && (obj.lsfUrl = message.lsfUrl); message.lsfRevision !== undefined && (obj.lsfRevision = Math.round(message.lsfRevision)); message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); - message.managedAclExtensionRequestFlowUrl !== undefined - && (obj.managedAclExtensionRequestFlowUrl = message.managedAclExtensionRequestFlowUrl); message.commissioningModeInitialStepsHint !== undefined && (obj.commissioningModeInitialStepsHint = Math.round(message.commissioningModeInitialStepsHint)); message.enhancedSetupFlowOptions !== undefined @@ -746,6 +753,7 @@ export const MsgUpdateModel = { message.enhancedSetupFlowTCFileSize !== undefined && (obj.enhancedSetupFlowTCFileSize = Math.round(message.enhancedSetupFlowTCFileSize)); message.maintenanceUrl !== undefined && (obj.maintenanceUrl = message.maintenanceUrl); + message.commissioningFallbackUrl !== undefined && (obj.commissioningFallbackUrl = message.commissioningFallbackUrl); return obj; }, @@ -766,7 +774,6 @@ export const MsgUpdateModel = { message.lsfUrl = object.lsfUrl ?? ""; message.lsfRevision = object.lsfRevision ?? 0; message.schemaVersion = object.schemaVersion ?? 0; - message.managedAclExtensionRequestFlowUrl = object.managedAclExtensionRequestFlowUrl ?? ""; message.commissioningModeInitialStepsHint = object.commissioningModeInitialStepsHint ?? 0; message.enhancedSetupFlowOptions = object.enhancedSetupFlowOptions ?? 0; message.enhancedSetupFlowTCUrl = object.enhancedSetupFlowTCUrl ?? ""; @@ -774,6 +781,7 @@ export const MsgUpdateModel = { message.enhancedSetupFlowTCDigest = object.enhancedSetupFlowTCDigest ?? ""; message.enhancedSetupFlowTCFileSize = object.enhancedSetupFlowTCFileSize ?? 0; message.maintenanceUrl = object.maintenanceUrl ?? ""; + message.commissioningFallbackUrl = object.commissioningFallbackUrl ?? ""; return message; }, }; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/api.swagger.yml b/ts-client/zigbeealliance.distributedcomplianceledger.pki/api.swagger.yml index 4dcf819c0..d573eea0a 100644 --- a/ts-client/zigbeealliance.distributedcomplianceledger.pki/api.swagger.yml +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/api.swagger.yml @@ -474,7 +474,7 @@ paths: type: boolean tags: - Query - /dcl/pki/noc-certificates/{vid}: + /dcl/pki/noc-vid-certificates/{vid}: get: operationId: NocCertificates responses: @@ -703,7 +703,7 @@ paths: type: boolean tags: - Query - /dcl/pki/noc-root-certificates/{vid}: + /dcl/pki/noc-vid-root-certificates/{vid}: get: operationId: NocRootCertificates responses: diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/module.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/module.ts index 592879cbd..8bcd7471d 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.pki/module.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/module.ts @@ -7,25 +7,27 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; -import { MsgApproveAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgProposeRevokeX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgAddX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgRevokeNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgRemoveNocX509IcaCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgRevokeNocX509IcaCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgDeletePkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgAddNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgRemoveNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgAddX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgUpdatePkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgRejectAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgRevokeNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgProposeAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgAddPkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgProposeRevokeX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgAddNocX509IcaCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgAssignVid } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgRemoveX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgRevokeX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgApproveRevokeX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgUpdatePkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgApproveAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgDeletePkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgAddNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgRevokeX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgRevokeNocX509IcaCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgProposeAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgAddPkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgRemoveX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { AllCertificates as typeAllCertificates} from "./types" +import { AllCertificatesBySubject as typeAllCertificatesBySubject} from "./types" import { ApprovedCertificates as typeApprovedCertificates} from "./types" import { ApprovedCertificatesBySubject as typeApprovedCertificatesBySubject} from "./types" import { ApprovedCertificatesBySubjectKeyId as typeApprovedCertificatesBySubjectKeyId} from "./types" @@ -34,47 +36,45 @@ import { Certificate as typeCertificate} from "./types" import { CertificateIdentifier as typeCertificateIdentifier} from "./types" import { ChildCertificates as typeChildCertificates} from "./types" import { Grant as typeGrant} from "./types" +import { NocCertificates as typeNocCertificates} from "./types" +import { NocCertificatesBySubject as typeNocCertificatesBySubject} from "./types" +import { NocCertificatesBySubjectKeyID as typeNocCertificatesBySubjectKeyID} from "./types" +import { NocCertificatesByVidAndSkid as typeNocCertificatesByVidAndSkid} from "./types" import { NocIcaCertificates as typeNocIcaCertificates} from "./types" import { NocRootCertificates as typeNocRootCertificates} from "./types" -import { NocRootCertificatesByVidAndSkid as typeNocRootCertificatesByVidAndSkid} from "./types" import { PkiRevocationDistributionPoint as typePkiRevocationDistributionPoint} from "./types" import { PkiRevocationDistributionPointsByIssuerSubjectKeyID as typePkiRevocationDistributionPointsByIssuerSubjectKeyID} from "./types" import { ProposedCertificate as typeProposedCertificate} from "./types" import { ProposedCertificateRevocation as typeProposedCertificateRevocation} from "./types" import { RejectedCertificate as typeRejectedCertificate} from "./types" import { RevokedCertificates as typeRevokedCertificates} from "./types" +import { RevokedNocIcaCertificates as typeRevokedNocIcaCertificates} from "./types" import { RevokedNocRootCertificates as typeRevokedNocRootCertificates} from "./types" import { RevokedRootCertificates as typeRevokedRootCertificates} from "./types" import { UniqueCertificate as typeUniqueCertificate} from "./types" -export { MsgApproveAddX509RootCert, MsgRemoveNocX509IcaCert, MsgRevokeNocX509IcaCert, MsgDeletePkiRevocationDistributionPoint, MsgAddNocX509RootCert, MsgRemoveNocX509RootCert, MsgAddX509Cert, MsgRejectAddX509RootCert, MsgRevokeNocX509RootCert, MsgProposeAddX509RootCert, MsgAddPkiRevocationDistributionPoint, MsgProposeRevokeX509RootCert, MsgAddNocX509IcaCert, MsgAssignVid, MsgRemoveX509Cert, MsgRevokeX509Cert, MsgApproveRevokeX509RootCert, MsgUpdatePkiRevocationDistributionPoint }; - -type sendMsgApproveAddX509RootCertParams = { - value: MsgApproveAddX509RootCert, - fee?: StdFee, - memo?: string -}; +export { MsgProposeRevokeX509RootCert, MsgAddX509Cert, MsgRevokeNocX509RootCert, MsgRemoveNocX509IcaCert, MsgRemoveNocX509RootCert, MsgUpdatePkiRevocationDistributionPoint, MsgRejectAddX509RootCert, MsgAddNocX509IcaCert, MsgAssignVid, MsgApproveRevokeX509RootCert, MsgApproveAddX509RootCert, MsgDeletePkiRevocationDistributionPoint, MsgAddNocX509RootCert, MsgRevokeX509Cert, MsgRevokeNocX509IcaCert, MsgProposeAddX509RootCert, MsgAddPkiRevocationDistributionPoint, MsgRemoveX509Cert }; -type sendMsgRemoveNocX509IcaCertParams = { - value: MsgRemoveNocX509IcaCert, +type sendMsgProposeRevokeX509RootCertParams = { + value: MsgProposeRevokeX509RootCert, fee?: StdFee, memo?: string }; -type sendMsgRevokeNocX509IcaCertParams = { - value: MsgRevokeNocX509IcaCert, +type sendMsgAddX509CertParams = { + value: MsgAddX509Cert, fee?: StdFee, memo?: string }; -type sendMsgDeletePkiRevocationDistributionPointParams = { - value: MsgDeletePkiRevocationDistributionPoint, +type sendMsgRevokeNocX509RootCertParams = { + value: MsgRevokeNocX509RootCert, fee?: StdFee, memo?: string }; -type sendMsgAddNocX509RootCertParams = { - value: MsgAddNocX509RootCert, +type sendMsgRemoveNocX509IcaCertParams = { + value: MsgRemoveNocX509IcaCert, fee?: StdFee, memo?: string }; @@ -85,8 +85,8 @@ type sendMsgRemoveNocX509RootCertParams = { memo?: string }; -type sendMsgAddX509CertParams = { - value: MsgAddX509Cert, +type sendMsgUpdatePkiRevocationDistributionPointParams = { + value: MsgUpdatePkiRevocationDistributionPoint, fee?: StdFee, memo?: string }; @@ -97,137 +97,143 @@ type sendMsgRejectAddX509RootCertParams = { memo?: string }; -type sendMsgRevokeNocX509RootCertParams = { - value: MsgRevokeNocX509RootCert, +type sendMsgAddNocX509IcaCertParams = { + value: MsgAddNocX509IcaCert, fee?: StdFee, memo?: string }; -type sendMsgProposeAddX509RootCertParams = { - value: MsgProposeAddX509RootCert, +type sendMsgAssignVidParams = { + value: MsgAssignVid, fee?: StdFee, memo?: string }; -type sendMsgAddPkiRevocationDistributionPointParams = { - value: MsgAddPkiRevocationDistributionPoint, +type sendMsgApproveRevokeX509RootCertParams = { + value: MsgApproveRevokeX509RootCert, fee?: StdFee, memo?: string }; -type sendMsgProposeRevokeX509RootCertParams = { - value: MsgProposeRevokeX509RootCert, +type sendMsgApproveAddX509RootCertParams = { + value: MsgApproveAddX509RootCert, fee?: StdFee, memo?: string }; -type sendMsgAddNocX509IcaCertParams = { - value: MsgAddNocX509IcaCert, +type sendMsgDeletePkiRevocationDistributionPointParams = { + value: MsgDeletePkiRevocationDistributionPoint, fee?: StdFee, memo?: string }; -type sendMsgAssignVidParams = { - value: MsgAssignVid, +type sendMsgAddNocX509RootCertParams = { + value: MsgAddNocX509RootCert, fee?: StdFee, memo?: string }; -type sendMsgRemoveX509CertParams = { - value: MsgRemoveX509Cert, +type sendMsgRevokeX509CertParams = { + value: MsgRevokeX509Cert, fee?: StdFee, memo?: string }; -type sendMsgRevokeX509CertParams = { - value: MsgRevokeX509Cert, +type sendMsgRevokeNocX509IcaCertParams = { + value: MsgRevokeNocX509IcaCert, fee?: StdFee, memo?: string }; -type sendMsgApproveRevokeX509RootCertParams = { - value: MsgApproveRevokeX509RootCert, +type sendMsgProposeAddX509RootCertParams = { + value: MsgProposeAddX509RootCert, fee?: StdFee, memo?: string }; -type sendMsgUpdatePkiRevocationDistributionPointParams = { - value: MsgUpdatePkiRevocationDistributionPoint, +type sendMsgAddPkiRevocationDistributionPointParams = { + value: MsgAddPkiRevocationDistributionPoint, fee?: StdFee, memo?: string }; - -type msgApproveAddX509RootCertParams = { - value: MsgApproveAddX509RootCert, +type sendMsgRemoveX509CertParams = { + value: MsgRemoveX509Cert, + fee?: StdFee, + memo?: string }; -type msgRemoveNocX509IcaCertParams = { - value: MsgRemoveNocX509IcaCert, + +type msgProposeRevokeX509RootCertParams = { + value: MsgProposeRevokeX509RootCert, }; -type msgRevokeNocX509IcaCertParams = { - value: MsgRevokeNocX509IcaCert, +type msgAddX509CertParams = { + value: MsgAddX509Cert, }; -type msgDeletePkiRevocationDistributionPointParams = { - value: MsgDeletePkiRevocationDistributionPoint, +type msgRevokeNocX509RootCertParams = { + value: MsgRevokeNocX509RootCert, }; -type msgAddNocX509RootCertParams = { - value: MsgAddNocX509RootCert, +type msgRemoveNocX509IcaCertParams = { + value: MsgRemoveNocX509IcaCert, }; type msgRemoveNocX509RootCertParams = { value: MsgRemoveNocX509RootCert, }; -type msgAddX509CertParams = { - value: MsgAddX509Cert, +type msgUpdatePkiRevocationDistributionPointParams = { + value: MsgUpdatePkiRevocationDistributionPoint, }; type msgRejectAddX509RootCertParams = { value: MsgRejectAddX509RootCert, }; -type msgRevokeNocX509RootCertParams = { - value: MsgRevokeNocX509RootCert, -}; - -type msgProposeAddX509RootCertParams = { - value: MsgProposeAddX509RootCert, +type msgAddNocX509IcaCertParams = { + value: MsgAddNocX509IcaCert, }; -type msgAddPkiRevocationDistributionPointParams = { - value: MsgAddPkiRevocationDistributionPoint, +type msgAssignVidParams = { + value: MsgAssignVid, }; -type msgProposeRevokeX509RootCertParams = { - value: MsgProposeRevokeX509RootCert, +type msgApproveRevokeX509RootCertParams = { + value: MsgApproveRevokeX509RootCert, }; -type msgAddNocX509IcaCertParams = { - value: MsgAddNocX509IcaCert, +type msgApproveAddX509RootCertParams = { + value: MsgApproveAddX509RootCert, }; -type msgAssignVidParams = { - value: MsgAssignVid, +type msgDeletePkiRevocationDistributionPointParams = { + value: MsgDeletePkiRevocationDistributionPoint, }; -type msgRemoveX509CertParams = { - value: MsgRemoveX509Cert, +type msgAddNocX509RootCertParams = { + value: MsgAddNocX509RootCert, }; type msgRevokeX509CertParams = { value: MsgRevokeX509Cert, }; -type msgApproveRevokeX509RootCertParams = { - value: MsgApproveRevokeX509RootCert, +type msgRevokeNocX509IcaCertParams = { + value: MsgRevokeNocX509IcaCert, }; -type msgUpdatePkiRevocationDistributionPointParams = { - value: MsgUpdatePkiRevocationDistributionPoint, +type msgProposeAddX509RootCertParams = { + value: MsgProposeAddX509RootCert, +}; + +type msgAddPkiRevocationDistributionPointParams = { + value: MsgAddPkiRevocationDistributionPoint, +}; + +type msgRemoveX509CertParams = { + value: MsgRemoveX509Cert, }; @@ -260,73 +266,59 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { - async sendMsgApproveAddX509RootCert({ value, fee, memo }: sendMsgApproveAddX509RootCertParams): Promise { - if (!signer) { - throw new Error('TxClient:sendMsgApproveAddX509RootCert: Unable to sign Tx. Signer is not present.') - } - try { - const { address } = (await signer.getAccounts())[0]; - const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgApproveAddX509RootCert({ value: MsgApproveAddX509RootCert.fromPartial(value) }) - return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) - } catch (e: any) { - throw new Error('TxClient:sendMsgApproveAddX509RootCert: Could not broadcast Tx: '+ e.message) - } - }, - - async sendMsgRemoveNocX509IcaCert({ value, fee, memo }: sendMsgRemoveNocX509IcaCertParams): Promise { + async sendMsgProposeRevokeX509RootCert({ value, fee, memo }: sendMsgProposeRevokeX509RootCertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgRemoveNocX509IcaCert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgProposeRevokeX509RootCert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgRemoveNocX509IcaCert({ value: MsgRemoveNocX509IcaCert.fromPartial(value) }) + let msg = this.msgProposeRevokeX509RootCert({ value: MsgProposeRevokeX509RootCert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgRemoveNocX509IcaCert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgProposeRevokeX509RootCert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgRevokeNocX509IcaCert({ value, fee, memo }: sendMsgRevokeNocX509IcaCertParams): Promise { + async sendMsgAddX509Cert({ value, fee, memo }: sendMsgAddX509CertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgRevokeNocX509IcaCert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgAddX509Cert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgRevokeNocX509IcaCert({ value: MsgRevokeNocX509IcaCert.fromPartial(value) }) + let msg = this.msgAddX509Cert({ value: MsgAddX509Cert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgRevokeNocX509IcaCert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgAddX509Cert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgDeletePkiRevocationDistributionPoint({ value, fee, memo }: sendMsgDeletePkiRevocationDistributionPointParams): Promise { + async sendMsgRevokeNocX509RootCert({ value, fee, memo }: sendMsgRevokeNocX509RootCertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgDeletePkiRevocationDistributionPoint: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgRevokeNocX509RootCert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgDeletePkiRevocationDistributionPoint({ value: MsgDeletePkiRevocationDistributionPoint.fromPartial(value) }) + let msg = this.msgRevokeNocX509RootCert({ value: MsgRevokeNocX509RootCert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgDeletePkiRevocationDistributionPoint: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgRevokeNocX509RootCert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgAddNocX509RootCert({ value, fee, memo }: sendMsgAddNocX509RootCertParams): Promise { + async sendMsgRemoveNocX509IcaCert({ value, fee, memo }: sendMsgRemoveNocX509IcaCertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgAddNocX509RootCert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgRemoveNocX509IcaCert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgAddNocX509RootCert({ value: MsgAddNocX509RootCert.fromPartial(value) }) + let msg = this.msgRemoveNocX509IcaCert({ value: MsgRemoveNocX509IcaCert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgAddNocX509RootCert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgRemoveNocX509IcaCert: Could not broadcast Tx: '+ e.message) } }, @@ -344,17 +336,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgAddX509Cert({ value, fee, memo }: sendMsgAddX509CertParams): Promise { + async sendMsgUpdatePkiRevocationDistributionPoint({ value, fee, memo }: sendMsgUpdatePkiRevocationDistributionPointParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgAddX509Cert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgUpdatePkiRevocationDistributionPoint: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgAddX509Cert({ value: MsgAddX509Cert.fromPartial(value) }) + let msg = this.msgUpdatePkiRevocationDistributionPoint({ value: MsgUpdatePkiRevocationDistributionPoint.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgAddX509Cert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgUpdatePkiRevocationDistributionPoint: Could not broadcast Tx: '+ e.message) } }, @@ -372,184 +364,190 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgRevokeNocX509RootCert({ value, fee, memo }: sendMsgRevokeNocX509RootCertParams): Promise { + async sendMsgAddNocX509IcaCert({ value, fee, memo }: sendMsgAddNocX509IcaCertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgRevokeNocX509RootCert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgAddNocX509IcaCert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgRevokeNocX509RootCert({ value: MsgRevokeNocX509RootCert.fromPartial(value) }) + let msg = this.msgAddNocX509IcaCert({ value: MsgAddNocX509IcaCert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgRevokeNocX509RootCert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgAddNocX509IcaCert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgProposeAddX509RootCert({ value, fee, memo }: sendMsgProposeAddX509RootCertParams): Promise { + async sendMsgAssignVid({ value, fee, memo }: sendMsgAssignVidParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgProposeAddX509RootCert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgAssignVid: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgProposeAddX509RootCert({ value: MsgProposeAddX509RootCert.fromPartial(value) }) + let msg = this.msgAssignVid({ value: MsgAssignVid.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgProposeAddX509RootCert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgAssignVid: Could not broadcast Tx: '+ e.message) } }, - async sendMsgAddPkiRevocationDistributionPoint({ value, fee, memo }: sendMsgAddPkiRevocationDistributionPointParams): Promise { + async sendMsgApproveRevokeX509RootCert({ value, fee, memo }: sendMsgApproveRevokeX509RootCertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgAddPkiRevocationDistributionPoint: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgApproveRevokeX509RootCert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgAddPkiRevocationDistributionPoint({ value: MsgAddPkiRevocationDistributionPoint.fromPartial(value) }) + let msg = this.msgApproveRevokeX509RootCert({ value: MsgApproveRevokeX509RootCert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgAddPkiRevocationDistributionPoint: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgApproveRevokeX509RootCert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgProposeRevokeX509RootCert({ value, fee, memo }: sendMsgProposeRevokeX509RootCertParams): Promise { + async sendMsgApproveAddX509RootCert({ value, fee, memo }: sendMsgApproveAddX509RootCertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgProposeRevokeX509RootCert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgApproveAddX509RootCert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgProposeRevokeX509RootCert({ value: MsgProposeRevokeX509RootCert.fromPartial(value) }) + let msg = this.msgApproveAddX509RootCert({ value: MsgApproveAddX509RootCert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgProposeRevokeX509RootCert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgApproveAddX509RootCert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgAddNocX509IcaCert({ value, fee, memo }: sendMsgAddNocX509IcaCertParams): Promise { + async sendMsgDeletePkiRevocationDistributionPoint({ value, fee, memo }: sendMsgDeletePkiRevocationDistributionPointParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgAddNocX509IcaCert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgDeletePkiRevocationDistributionPoint: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgAddNocX509IcaCert({ value: MsgAddNocX509IcaCert.fromPartial(value) }) + let msg = this.msgDeletePkiRevocationDistributionPoint({ value: MsgDeletePkiRevocationDistributionPoint.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgAddNocX509IcaCert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgDeletePkiRevocationDistributionPoint: Could not broadcast Tx: '+ e.message) } }, - async sendMsgAssignVid({ value, fee, memo }: sendMsgAssignVidParams): Promise { + async sendMsgAddNocX509RootCert({ value, fee, memo }: sendMsgAddNocX509RootCertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgAssignVid: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgAddNocX509RootCert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgAssignVid({ value: MsgAssignVid.fromPartial(value) }) + let msg = this.msgAddNocX509RootCert({ value: MsgAddNocX509RootCert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgAssignVid: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgAddNocX509RootCert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgRemoveX509Cert({ value, fee, memo }: sendMsgRemoveX509CertParams): Promise { + async sendMsgRevokeX509Cert({ value, fee, memo }: sendMsgRevokeX509CertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgRemoveX509Cert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgRevokeX509Cert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgRemoveX509Cert({ value: MsgRemoveX509Cert.fromPartial(value) }) + let msg = this.msgRevokeX509Cert({ value: MsgRevokeX509Cert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgRemoveX509Cert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgRevokeX509Cert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgRevokeX509Cert({ value, fee, memo }: sendMsgRevokeX509CertParams): Promise { + async sendMsgRevokeNocX509IcaCert({ value, fee, memo }: sendMsgRevokeNocX509IcaCertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgRevokeX509Cert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgRevokeNocX509IcaCert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgRevokeX509Cert({ value: MsgRevokeX509Cert.fromPartial(value) }) + let msg = this.msgRevokeNocX509IcaCert({ value: MsgRevokeNocX509IcaCert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgRevokeX509Cert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgRevokeNocX509IcaCert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgApproveRevokeX509RootCert({ value, fee, memo }: sendMsgApproveRevokeX509RootCertParams): Promise { + async sendMsgProposeAddX509RootCert({ value, fee, memo }: sendMsgProposeAddX509RootCertParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgApproveRevokeX509RootCert: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgProposeAddX509RootCert: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgApproveRevokeX509RootCert({ value: MsgApproveRevokeX509RootCert.fromPartial(value) }) + let msg = this.msgProposeAddX509RootCert({ value: MsgProposeAddX509RootCert.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgApproveRevokeX509RootCert: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgProposeAddX509RootCert: Could not broadcast Tx: '+ e.message) } }, - async sendMsgUpdatePkiRevocationDistributionPoint({ value, fee, memo }: sendMsgUpdatePkiRevocationDistributionPointParams): Promise { + async sendMsgAddPkiRevocationDistributionPoint({ value, fee, memo }: sendMsgAddPkiRevocationDistributionPointParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgUpdatePkiRevocationDistributionPoint: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgAddPkiRevocationDistributionPoint: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgUpdatePkiRevocationDistributionPoint({ value: MsgUpdatePkiRevocationDistributionPoint.fromPartial(value) }) + let msg = this.msgAddPkiRevocationDistributionPoint({ value: MsgAddPkiRevocationDistributionPoint.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgUpdatePkiRevocationDistributionPoint: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgAddPkiRevocationDistributionPoint: Could not broadcast Tx: '+ e.message) } }, - - msgApproveAddX509RootCert({ value }: msgApproveAddX509RootCertParams): EncodeObject { - try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgApproveAddX509RootCert", value: MsgApproveAddX509RootCert.fromPartial( value ) } + async sendMsgRemoveX509Cert({ value, fee, memo }: sendMsgRemoveX509CertParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgRemoveX509Cert: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgRemoveX509Cert({ value: MsgRemoveX509Cert.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:MsgApproveAddX509RootCert: Could not create message: ' + e.message) + throw new Error('TxClient:sendMsgRemoveX509Cert: Could not broadcast Tx: '+ e.message) } }, - msgRemoveNocX509IcaCert({ value }: msgRemoveNocX509IcaCertParams): EncodeObject { + + msgProposeRevokeX509RootCert({ value }: msgProposeRevokeX509RootCertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveNocX509IcaCert", value: MsgRemoveNocX509IcaCert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgProposeRevokeX509RootCert", value: MsgProposeRevokeX509RootCert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgRemoveNocX509IcaCert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgProposeRevokeX509RootCert: Could not create message: ' + e.message) } }, - msgRevokeNocX509IcaCert({ value }: msgRevokeNocX509IcaCertParams): EncodeObject { + msgAddX509Cert({ value }: msgAddX509CertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeNocX509IcaCert", value: MsgRevokeNocX509IcaCert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAddX509Cert", value: MsgAddX509Cert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgRevokeNocX509IcaCert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddX509Cert: Could not create message: ' + e.message) } }, - msgDeletePkiRevocationDistributionPoint({ value }: msgDeletePkiRevocationDistributionPointParams): EncodeObject { + msgRevokeNocX509RootCert({ value }: msgRevokeNocX509RootCertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgDeletePkiRevocationDistributionPoint", value: MsgDeletePkiRevocationDistributionPoint.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeNocX509RootCert", value: MsgRevokeNocX509RootCert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgDeletePkiRevocationDistributionPoint: Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevokeNocX509RootCert: Could not create message: ' + e.message) } }, - msgAddNocX509RootCert({ value }: msgAddNocX509RootCertParams): EncodeObject { + msgRemoveNocX509IcaCert({ value }: msgRemoveNocX509IcaCertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAddNocX509RootCert", value: MsgAddNocX509RootCert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveNocX509IcaCert", value: MsgRemoveNocX509IcaCert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgAddNocX509RootCert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgRemoveNocX509IcaCert: Could not create message: ' + e.message) } }, @@ -561,11 +559,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgAddX509Cert({ value }: msgAddX509CertParams): EncodeObject { + msgUpdatePkiRevocationDistributionPoint({ value }: msgUpdatePkiRevocationDistributionPointParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAddX509Cert", value: MsgAddX509Cert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgUpdatePkiRevocationDistributionPoint", value: MsgUpdatePkiRevocationDistributionPoint.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgAddX509Cert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgUpdatePkiRevocationDistributionPoint: Could not create message: ' + e.message) } }, @@ -577,83 +575,91 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgRevokeNocX509RootCert({ value }: msgRevokeNocX509RootCertParams): EncodeObject { + msgAddNocX509IcaCert({ value }: msgAddNocX509IcaCertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeNocX509RootCert", value: MsgRevokeNocX509RootCert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAddNocX509IcaCert", value: MsgAddNocX509IcaCert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgRevokeNocX509RootCert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddNocX509IcaCert: Could not create message: ' + e.message) } }, - msgProposeAddX509RootCert({ value }: msgProposeAddX509RootCertParams): EncodeObject { + msgAssignVid({ value }: msgAssignVidParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgProposeAddX509RootCert", value: MsgProposeAddX509RootCert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAssignVid", value: MsgAssignVid.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgProposeAddX509RootCert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgAssignVid: Could not create message: ' + e.message) } }, - msgAddPkiRevocationDistributionPoint({ value }: msgAddPkiRevocationDistributionPointParams): EncodeObject { + msgApproveRevokeX509RootCert({ value }: msgApproveRevokeX509RootCertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAddPkiRevocationDistributionPoint", value: MsgAddPkiRevocationDistributionPoint.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgApproveRevokeX509RootCert", value: MsgApproveRevokeX509RootCert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgAddPkiRevocationDistributionPoint: Could not create message: ' + e.message) + throw new Error('TxClient:MsgApproveRevokeX509RootCert: Could not create message: ' + e.message) } }, - msgProposeRevokeX509RootCert({ value }: msgProposeRevokeX509RootCertParams): EncodeObject { + msgApproveAddX509RootCert({ value }: msgApproveAddX509RootCertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgProposeRevokeX509RootCert", value: MsgProposeRevokeX509RootCert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgApproveAddX509RootCert", value: MsgApproveAddX509RootCert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgProposeRevokeX509RootCert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgApproveAddX509RootCert: Could not create message: ' + e.message) } }, - msgAddNocX509IcaCert({ value }: msgAddNocX509IcaCertParams): EncodeObject { + msgDeletePkiRevocationDistributionPoint({ value }: msgDeletePkiRevocationDistributionPointParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAddNocX509IcaCert", value: MsgAddNocX509IcaCert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgDeletePkiRevocationDistributionPoint", value: MsgDeletePkiRevocationDistributionPoint.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgAddNocX509IcaCert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgDeletePkiRevocationDistributionPoint: Could not create message: ' + e.message) } }, - msgAssignVid({ value }: msgAssignVidParams): EncodeObject { + msgAddNocX509RootCert({ value }: msgAddNocX509RootCertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAssignVid", value: MsgAssignVid.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAddNocX509RootCert", value: MsgAddNocX509RootCert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgAssignVid: Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddNocX509RootCert: Could not create message: ' + e.message) } }, - msgRemoveX509Cert({ value }: msgRemoveX509CertParams): EncodeObject { + msgRevokeX509Cert({ value }: msgRevokeX509CertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveX509Cert", value: MsgRemoveX509Cert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeX509Cert", value: MsgRevokeX509Cert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgRemoveX509Cert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevokeX509Cert: Could not create message: ' + e.message) } }, - msgRevokeX509Cert({ value }: msgRevokeX509CertParams): EncodeObject { + msgRevokeNocX509IcaCert({ value }: msgRevokeNocX509IcaCertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeX509Cert", value: MsgRevokeX509Cert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeNocX509IcaCert", value: MsgRevokeNocX509IcaCert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgRevokeX509Cert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgRevokeNocX509IcaCert: Could not create message: ' + e.message) } }, - msgApproveRevokeX509RootCert({ value }: msgApproveRevokeX509RootCertParams): EncodeObject { + msgProposeAddX509RootCert({ value }: msgProposeAddX509RootCertParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgApproveRevokeX509RootCert", value: MsgApproveRevokeX509RootCert.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgProposeAddX509RootCert", value: MsgProposeAddX509RootCert.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgApproveRevokeX509RootCert: Could not create message: ' + e.message) + throw new Error('TxClient:MsgProposeAddX509RootCert: Could not create message: ' + e.message) } }, - msgUpdatePkiRevocationDistributionPoint({ value }: msgUpdatePkiRevocationDistributionPointParams): EncodeObject { + msgAddPkiRevocationDistributionPoint({ value }: msgAddPkiRevocationDistributionPointParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgUpdatePkiRevocationDistributionPoint", value: MsgUpdatePkiRevocationDistributionPoint.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgAddPkiRevocationDistributionPoint", value: MsgAddPkiRevocationDistributionPoint.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgUpdatePkiRevocationDistributionPoint: Could not create message: ' + e.message) + throw new Error('TxClient:MsgAddPkiRevocationDistributionPoint: Could not create message: ' + e.message) + } + }, + + msgRemoveX509Cert({ value }: msgRemoveX509CertParams): EncodeObject { + try { + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveX509Cert", value: MsgRemoveX509Cert.fromPartial( value ) } + } catch (e: any) { + throw new Error('TxClient:MsgRemoveX509Cert: Could not create message: ' + e.message) } }, @@ -679,6 +685,8 @@ class SDKModule { this.query = queryClient({ addr: client.env.apiURL }); this.updateTX(client); this.structure = { + AllCertificates: getStructure(typeAllCertificates.fromPartial({})), + AllCertificatesBySubject: getStructure(typeAllCertificatesBySubject.fromPartial({})), ApprovedCertificates: getStructure(typeApprovedCertificates.fromPartial({})), ApprovedCertificatesBySubject: getStructure(typeApprovedCertificatesBySubject.fromPartial({})), ApprovedCertificatesBySubjectKeyId: getStructure(typeApprovedCertificatesBySubjectKeyId.fromPartial({})), @@ -687,15 +695,19 @@ class SDKModule { CertificateIdentifier: getStructure(typeCertificateIdentifier.fromPartial({})), ChildCertificates: getStructure(typeChildCertificates.fromPartial({})), Grant: getStructure(typeGrant.fromPartial({})), + NocCertificates: getStructure(typeNocCertificates.fromPartial({})), + NocCertificatesBySubject: getStructure(typeNocCertificatesBySubject.fromPartial({})), + NocCertificatesBySubjectKeyID: getStructure(typeNocCertificatesBySubjectKeyID.fromPartial({})), + NocCertificatesByVidAndSkid: getStructure(typeNocCertificatesByVidAndSkid.fromPartial({})), NocIcaCertificates: getStructure(typeNocIcaCertificates.fromPartial({})), NocRootCertificates: getStructure(typeNocRootCertificates.fromPartial({})), - NocRootCertificatesByVidAndSkid: getStructure(typeNocRootCertificatesByVidAndSkid.fromPartial({})), PkiRevocationDistributionPoint: getStructure(typePkiRevocationDistributionPoint.fromPartial({})), PkiRevocationDistributionPointsByIssuerSubjectKeyID: getStructure(typePkiRevocationDistributionPointsByIssuerSubjectKeyID.fromPartial({})), ProposedCertificate: getStructure(typeProposedCertificate.fromPartial({})), ProposedCertificateRevocation: getStructure(typeProposedCertificateRevocation.fromPartial({})), RejectedCertificate: getStructure(typeRejectedCertificate.fromPartial({})), RevokedCertificates: getStructure(typeRevokedCertificates.fromPartial({})), + RevokedNocIcaCertificates: getStructure(typeRevokedNocIcaCertificates.fromPartial({})), RevokedNocRootCertificates: getStructure(typeRevokedNocRootCertificates.fromPartial({})), RevokedRootCertificates: getStructure(typeRevokedRootCertificates.fromPartial({})), UniqueCertificate: getStructure(typeUniqueCertificate.fromPartial({})), diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/registry.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/registry.ts index be9dfb365..967d931ad 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.pki/registry.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/registry.ts @@ -1,42 +1,42 @@ import { GeneratedType } from "@cosmjs/proto-signing"; -import { MsgApproveAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgProposeRevokeX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgAddX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgRevokeNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgRemoveNocX509IcaCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgRevokeNocX509IcaCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgDeletePkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgAddNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgRemoveNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgAddX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgUpdatePkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgRejectAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgRevokeNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgProposeAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgAddPkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgProposeRevokeX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgAddNocX509IcaCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgAssignVid } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgRemoveX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgRevokeX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; import { MsgApproveRevokeX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; -import { MsgUpdatePkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgApproveAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgDeletePkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgAddNocX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgRevokeX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgRevokeNocX509IcaCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgProposeAddX509RootCert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgAddPkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; +import { MsgRemoveX509Cert } from "./types/zigbeealliance/distributedcomplianceledger/pki/tx"; const msgTypes: Array<[string, GeneratedType]> = [ - ["/zigbeealliance.distributedcomplianceledger.pki.MsgApproveAddX509RootCert", MsgApproveAddX509RootCert], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgProposeRevokeX509RootCert", MsgProposeRevokeX509RootCert], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgAddX509Cert", MsgAddX509Cert], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeNocX509RootCert", MsgRevokeNocX509RootCert], ["/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveNocX509IcaCert", MsgRemoveNocX509IcaCert], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeNocX509IcaCert", MsgRevokeNocX509IcaCert], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgDeletePkiRevocationDistributionPoint", MsgDeletePkiRevocationDistributionPoint], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgAddNocX509RootCert", MsgAddNocX509RootCert], ["/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveNocX509RootCert", MsgRemoveNocX509RootCert], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgAddX509Cert", MsgAddX509Cert], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgUpdatePkiRevocationDistributionPoint", MsgUpdatePkiRevocationDistributionPoint], ["/zigbeealliance.distributedcomplianceledger.pki.MsgRejectAddX509RootCert", MsgRejectAddX509RootCert], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeNocX509RootCert", MsgRevokeNocX509RootCert], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgProposeAddX509RootCert", MsgProposeAddX509RootCert], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgAddPkiRevocationDistributionPoint", MsgAddPkiRevocationDistributionPoint], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgProposeRevokeX509RootCert", MsgProposeRevokeX509RootCert], ["/zigbeealliance.distributedcomplianceledger.pki.MsgAddNocX509IcaCert", MsgAddNocX509IcaCert], ["/zigbeealliance.distributedcomplianceledger.pki.MsgAssignVid", MsgAssignVid], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveX509Cert", MsgRemoveX509Cert], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeX509Cert", MsgRevokeX509Cert], ["/zigbeealliance.distributedcomplianceledger.pki.MsgApproveRevokeX509RootCert", MsgApproveRevokeX509RootCert], - ["/zigbeealliance.distributedcomplianceledger.pki.MsgUpdatePkiRevocationDistributionPoint", MsgUpdatePkiRevocationDistributionPoint], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgApproveAddX509RootCert", MsgApproveAddX509RootCert], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgDeletePkiRevocationDistributionPoint", MsgDeletePkiRevocationDistributionPoint], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgAddNocX509RootCert", MsgAddNocX509RootCert], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeX509Cert", MsgRevokeX509Cert], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgRevokeNocX509IcaCert", MsgRevokeNocX509IcaCert], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgProposeAddX509RootCert", MsgProposeAddX509RootCert], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgAddPkiRevocationDistributionPoint", MsgAddPkiRevocationDistributionPoint], + ["/zigbeealliance.distributedcomplianceledger.pki.MsgRemoveX509Cert", MsgRemoveX509Cert], ]; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/rest.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/rest.ts index 9617e39bc..742cc3231 100644 --- a/ts-client/zigbeealliance.distributedcomplianceledger.pki/rest.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/rest.ts @@ -9,6 +9,14 @@ * --------------------------------------------------------------- */ +export interface DistributedcomplianceledgerpkiAllCertificatesBySubject { + subject?: string; + subjectKeyIds?: string[]; + + /** @format int64 */ + schemaVersion?: number; +} + export interface DistributedcomplianceledgerpkiApprovedCertificates { subject?: string; subjectKeyId?: string; @@ -42,16 +50,40 @@ export interface DistributedcomplianceledgerpkiChildCertificates { schemaVersion?: number; } -export interface DistributedcomplianceledgerpkiNocIcaCertificates { +export interface DistributedcomplianceledgerpkiNocCertificates { + subject?: string; + subjectKeyId?: string; + certs?: PkiCertificate[]; + + /** @format float */ + tq?: number; + + /** @format int64 */ + schemaVersion?: number; +} + +export interface DistributedcomplianceledgerpkiNocCertificatesBySubject { + subject?: string; + subjectKeyIds?: string[]; + + /** @format int64 */ + schemaVersion?: number; +} + +export interface DistributedcomplianceledgerpkiNocCertificatesByVidAndSkid { /** @format int32 */ vid?: number; + subjectKeyId?: string; certs?: PkiCertificate[]; + /** @format float */ + tq?: number; + /** @format int64 */ schemaVersion?: number; } -export interface DistributedcomplianceledgerpkiNocRootCertificates { +export interface DistributedcomplianceledgerpkiNocIcaCertificates { /** @format int32 */ vid?: number; certs?: PkiCertificate[]; @@ -60,15 +92,11 @@ export interface DistributedcomplianceledgerpkiNocRootCertificates { schemaVersion?: number; } -export interface DistributedcomplianceledgerpkiNocRootCertificatesByVidAndSkid { +export interface DistributedcomplianceledgerpkiNocRootCertificates { /** @format int32 */ vid?: number; - subjectKeyId?: string; certs?: PkiCertificate[]; - /** @format float */ - tq?: number; - /** @format int64 */ schemaVersion?: number; } @@ -158,6 +186,15 @@ export interface DistributedcomplianceledgerpkiRevokedCertificates { schemaVersion?: number; } +export interface DistributedcomplianceledgerpkiRevokedNocIcaCertificates { + subject?: string; + subjectKeyId?: string; + certs?: PkiCertificate[]; + + /** @format int64 */ + schemaVersion?: number; +} + export interface DistributedcomplianceledgerpkiRevokedNocRootCertificates { subject?: string; subjectKeyId?: string; @@ -174,6 +211,15 @@ export interface DistributedcomplianceledgerpkiRevokedRootCertificates { schemaVersion?: number; } +export interface PkiAllCertificates { + subject?: string; + subjectKeyId?: string; + certs?: PkiCertificate[]; + + /** @format int64 */ + schemaVersion?: number; +} + export interface PkiCertificate { pemCert?: string; serialNumber?: string; @@ -191,7 +237,7 @@ export interface PkiCertificate { /** @format int32 */ vid?: number; - isNoc?: boolean; + certificateType?: PkiCertificateType; /** @format int64 */ schemaVersion?: number; @@ -202,6 +248,12 @@ export interface PkiCertificateIdentifier { subjectKeyId?: string; } +export enum PkiCertificateType { + DeviceAttestationPKI = "DeviceAttestationPKI", + OperationalPKI = "OperationalPKI", + VIDSignerPKI = "VIDSignerPKI", +} + export interface PkiGrant { address?: string; @@ -267,6 +319,21 @@ export interface PkiQueryAllApprovedCertificatesResponse { pagination?: V1Beta1PageResponse; } +export interface PkiQueryAllCertificatesResponse { + certificates?: PkiAllCertificates[]; + + /** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ + pagination?: V1Beta1PageResponse; +} + export interface PkiQueryAllNocIcaCertificatesResponse { nocIcaCertificates?: DistributedcomplianceledgerpkiNocIcaCertificates[]; @@ -372,6 +439,21 @@ export interface PkiQueryAllRevokedCertificatesResponse { pagination?: V1Beta1PageResponse; } +export interface PkiQueryAllRevokedNocIcaCertificatesResponse { + revokedNocIcaCertificates?: DistributedcomplianceledgerpkiRevokedNocIcaCertificates[]; + + /** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ + pagination?: V1Beta1PageResponse; +} + export interface PkiQueryAllRevokedNocRootCertificatesResponse { revokedNocRootCertificates?: DistributedcomplianceledgerpkiRevokedNocRootCertificates[]; @@ -387,6 +469,10 @@ export interface PkiQueryAllRevokedNocRootCertificatesResponse { pagination?: V1Beta1PageResponse; } +export interface PkiQueryGetAllCertificatesBySubjectResponse { + allCertificatesBySubject?: DistributedcomplianceledgerpkiAllCertificatesBySubject; +} + export interface PkiQueryGetApprovedCertificatesBySubjectResponse { approvedCertificatesBySubject?: DistributedcomplianceledgerpkiApprovedCertificatesBySubject; } @@ -399,16 +485,28 @@ export interface PkiQueryGetApprovedRootCertificatesResponse { approvedRootCertificates?: DistributedcomplianceledgerpkiApprovedRootCertificates; } +export interface PkiQueryGetCertificatesResponse { + certificates?: PkiAllCertificates; +} + export interface PkiQueryGetChildCertificatesResponse { childCertificates?: DistributedcomplianceledgerpkiChildCertificates; } -export interface PkiQueryGetNocIcaCertificatesResponse { - nocIcaCertificates?: DistributedcomplianceledgerpkiNocIcaCertificates; +export interface PkiQueryGetNocCertificatesBySubjectResponse { + nocCertificatesBySubject?: DistributedcomplianceledgerpkiNocCertificatesBySubject; +} + +export interface PkiQueryGetNocCertificatesByVidAndSkidResponse { + nocCertificatesByVidAndSkid?: DistributedcomplianceledgerpkiNocCertificatesByVidAndSkid; +} + +export interface PkiQueryGetNocCertificatesResponse { + nocCertificates?: DistributedcomplianceledgerpkiNocCertificates; } -export interface PkiQueryGetNocRootCertificatesByVidAndSkidResponse { - nocRootCertificatesByVidAndSkid?: DistributedcomplianceledgerpkiNocRootCertificatesByVidAndSkid; +export interface PkiQueryGetNocIcaCertificatesResponse { + nocIcaCertificates?: DistributedcomplianceledgerpkiNocIcaCertificates; } export interface PkiQueryGetNocRootCertificatesResponse { @@ -439,6 +537,10 @@ export interface PkiQueryGetRevokedCertificatesResponse { revokedCertificates?: DistributedcomplianceledgerpkiRevokedCertificates; } +export interface PkiQueryGetRevokedNocIcaCertificatesResponse { + revokedNocIcaCertificates?: DistributedcomplianceledgerpkiRevokedNocIcaCertificates; +} + export interface PkiQueryGetRevokedNocRootCertificatesResponse { revokedNocRootCertificates?: DistributedcomplianceledgerpkiRevokedNocRootCertificates; } @@ -447,6 +549,21 @@ export interface PkiQueryGetRevokedRootCertificatesResponse { revokedRootCertificates?: DistributedcomplianceledgerpkiRevokedRootCertificates; } +export interface PkiQueryNocCertificatesResponse { + nocCertificates?: DistributedcomplianceledgerpkiNocCertificates[]; + + /** + * PageResponse is to be embedded in gRPC response messages where the + * corresponding request message has used PageRequest. + * + * message SomeResponse { + * repeated Bar results = 1; + * PageResponse page = 2; + * } + */ + pagination?: V1Beta1PageResponse; +} + export interface ProtobufAny { "@type"?: string; } @@ -651,10 +768,127 @@ export class HttpClient { } /** - * @title zigbeealliance/distributedcomplianceledger/pki/approved_certificates.proto + * @title zigbeealliance/distributedcomplianceledger/pki/all_certificates.proto * @version version not set */ export class Api extends HttpClient { + /** + * No description + * + * @tags Query + * @name QueryCertificatesAll + * @summary Queries a list of Certificates items. + * @request GET:/dcl/pki/all-certificates + */ + queryCertificatesAll = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/dcl/pki/all-certificates`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryAllCertificatesBySubject + * @summary Queries a AllCertificatesBySubject by index. + * @request GET:/dcl/pki/all-certificates/{subject} + */ + queryAllCertificatesBySubject = (subject: string, params: RequestParams = {}) => + this.request({ + path: `/dcl/pki/all-certificates/${subject}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryCertificates + * @summary Queries a Certificates by index. + * @request GET:/dcl/pki/all-certificates/{subject}/{subjectKeyId} + */ + queryCertificates = (subject: string, subjectKeyId: string, params: RequestParams = {}) => + this.request({ + path: `/dcl/pki/all-certificates/${subject}/${subjectKeyId}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryNocCertificatesAll + * @summary Queries a list of NocCertificates items. + * @request GET:/dcl/pki/all-noc-certificates + */ + queryNocCertificatesAll = ( + query?: { + "pagination.key"?: string; + "pagination.offset"?: string; + "pagination.limit"?: string; + "pagination.count_total"?: boolean; + "pagination.reverse"?: boolean; + subjectKeyId?: string; + }, + params: RequestParams = {}, + ) => + this.request({ + path: `/dcl/pki/all-noc-certificates`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryNocCertificatesBySubject + * @summary Queries a NocCertificatesBySubject by index. + * @request GET:/dcl/pki/all-noc-certificates/{subject} + */ + queryNocCertificatesBySubject = (subject: string, params: RequestParams = {}) => + this.request({ + path: `/dcl/pki/all-noc-certificates/${subject}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryNocCertificates + * @summary Queries a NocCertificates by index. + * @request GET:/dcl/pki/all-noc-certificates/{subject}/{subjectKeyId} + */ + queryNocCertificates = (subject: string, subjectKeyId: string, params: RequestParams = {}) => + this.request({ + path: `/dcl/pki/all-noc-certificates/${subject}/${subjectKeyId}`, + method: "GET", + format: "json", + ...params, + }); + /** * No description * @@ -756,22 +990,6 @@ export class Api extends HttpClient - this.request({ - path: `/dcl/pki/noc-ica-certificates/${vid}`, - method: "GET", - format: "json", - ...params, - }); - /** * No description * @@ -802,13 +1020,13 @@ export class Api extends HttpClient - this.request({ - path: `/dcl/pki/noc-root-certificates/${vid}`, + queryNocCertificatesByVidAndSkid = (vid: number, subjectKeyId: string, params: RequestParams = {}) => + this.request({ + path: `/dcl/pki/noc-vid-certificates/${vid}/${subjectKeyId}`, method: "GET", format: "json", ...params, @@ -818,13 +1036,29 @@ export class Api extends HttpClient - this.request({ - path: `/dcl/pki/noc-root-certificates/${vid}/${subjectKeyId}`, + queryNocIcaCertificates = (vid: number, params: RequestParams = {}) => + this.request({ + path: `/dcl/pki/noc-vid-ica-certificates/${vid}`, + method: "GET", + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryNocRootCertificates + * @summary Queries a NocRootCertificates by index. + * @request GET:/dcl/pki/noc-vid-root-certificates/{vid} + */ + queryNocRootCertificates = (vid: number, params: RequestParams = {}) => + this.request({ + path: `/dcl/pki/noc-vid-root-certificates/${vid}`, method: "GET", format: "json", ...params, @@ -1067,6 +1301,48 @@ export class Api extends HttpClient + this.request({ + path: `/dcl/pki/revoked-noc-ica-certificates`, + method: "GET", + query: query, + format: "json", + ...params, + }); + + /** + * No description + * + * @tags Query + * @name QueryRevokedNocIcaCertificates + * @summary Queries a RevokedNocIcaCertificates by index. + * @request GET:/dcl/pki/revoked-noc-ica-certificates/{subject}/{subjectKeyId} + */ + queryRevokedNocIcaCertificates = (subject: string, subjectKeyId: string, params: RequestParams = {}) => + this.request({ + path: `/dcl/pki/revoked-noc-ica-certificates/${subject}/${subjectKeyId}`, + method: "GET", + format: "json", + ...params, + }); + /** * No description * diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types.ts index d1ee67322..97c81ee53 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types.ts @@ -1,3 +1,5 @@ +import { AllCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/all_certificates" +import { AllCertificatesBySubject } from "./types/zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject" import { ApprovedCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/approved_certificates" import { ApprovedCertificatesBySubject } from "./types/zigbeealliance/distributedcomplianceledger/pki/approved_certificates_by_subject" import { ApprovedCertificatesBySubjectKeyId } from "./types/zigbeealliance/distributedcomplianceledger/pki/approved_certificates_by_subject_key_id" @@ -6,21 +8,27 @@ import { Certificate } from "./types/zigbeealliance/distributedcomplianceledger/ import { CertificateIdentifier } from "./types/zigbeealliance/distributedcomplianceledger/pki/certificate_identifier" import { ChildCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/child_certificates" import { Grant } from "./types/zigbeealliance/distributedcomplianceledger/pki/grant" +import { NocCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates" +import { NocCertificatesBySubject } from "./types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject" +import { NocCertificatesBySubjectKeyID } from "./types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject_key_id" +import { NocCertificatesByVidAndSkid } from "./types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_vid_and_skid" import { NocIcaCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/noc_ica_certificates" import { NocRootCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/noc_root_certificates" -import { NocRootCertificatesByVidAndSkid } from "./types/zigbeealliance/distributedcomplianceledger/pki/noc_root_certificates_by_vid_and_skid" import { PkiRevocationDistributionPoint } from "./types/zigbeealliance/distributedcomplianceledger/pki/pki_revocation_distribution_point" import { PkiRevocationDistributionPointsByIssuerSubjectKeyID } from "./types/zigbeealliance/distributedcomplianceledger/pki/pki_revocation_distribution_points_by_issuer_subject_key_id" import { ProposedCertificate } from "./types/zigbeealliance/distributedcomplianceledger/pki/proposed_certificate" import { ProposedCertificateRevocation } from "./types/zigbeealliance/distributedcomplianceledger/pki/proposed_certificate_revocation" import { RejectedCertificate } from "./types/zigbeealliance/distributedcomplianceledger/pki/rejected_certificate" import { RevokedCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/revoked_certificates" +import { RevokedNocIcaCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/revoked_noc_ica_certificates" import { RevokedNocRootCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/revoked_noc_root_certificates" import { RevokedRootCertificates } from "./types/zigbeealliance/distributedcomplianceledger/pki/revoked_root_certificates" import { UniqueCertificate } from "./types/zigbeealliance/distributedcomplianceledger/pki/unique_certificate" export { + AllCertificates, + AllCertificatesBySubject, ApprovedCertificates, ApprovedCertificatesBySubject, ApprovedCertificatesBySubjectKeyId, @@ -29,15 +37,19 @@ export { CertificateIdentifier, ChildCertificates, Grant, + NocCertificates, + NocCertificatesBySubject, + NocCertificatesBySubjectKeyID, + NocCertificatesByVidAndSkid, NocIcaCertificates, NocRootCertificates, - NocRootCertificatesByVidAndSkid, PkiRevocationDistributionPoint, PkiRevocationDistributionPointsByIssuerSubjectKeyID, ProposedCertificate, ProposedCertificateRevocation, RejectedCertificate, RevokedCertificates, + RevokedNocIcaCertificates, RevokedNocRootCertificates, RevokedRootCertificates, UniqueCertificate, diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/all_certificates.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/all_certificates.ts new file mode 100644 index 000000000..e3593d84d --- /dev/null +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/all_certificates.ts @@ -0,0 +1,107 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Certificate } from "./certificate"; + +export const protobufPackage = "zigbeealliance.distributedcomplianceledger.pki"; + +export interface AllCertificates { + subject: string; + subjectKeyId: string; + certs: Certificate[]; + schemaVersion: number; +} + +function createBaseAllCertificates(): AllCertificates { + return { subject: "", subjectKeyId: "", certs: [], schemaVersion: 0 }; +} + +export const AllCertificates = { + encode(message: AllCertificates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); + } + for (const v of message.certs) { + Certificate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.schemaVersion !== 0) { + writer.uint32(32).uint32(message.schemaVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AllCertificates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllCertificates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subject = reader.string(); + break; + case 2: + message.subjectKeyId = reader.string(); + break; + case 3: + message.certs.push(Certificate.decode(reader, reader.uint32())); + break; + case 4: + message.schemaVersion = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AllCertificates { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + certs: Array.isArray(object?.certs) ? object.certs.map((e: any) => Certificate.fromJSON(e)) : [], + schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, + }; + }, + + toJSON(message: AllCertificates): unknown { + const obj: any = {}; + message.subject !== undefined && (obj.subject = message.subject); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + if (message.certs) { + obj.certs = message.certs.map((e) => e ? Certificate.toJSON(e) : undefined); + } else { + obj.certs = []; + } + message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); + return obj; + }, + + fromPartial, I>>(object: I): AllCertificates { + const message = createBaseAllCertificates(); + message.subject = object.subject ?? ""; + message.subjectKeyId = object.subjectKeyId ?? ""; + message.certs = object.certs?.map((e) => Certificate.fromPartial(e)) || []; + message.schemaVersion = object.schemaVersion ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.ts new file mode 100644 index 000000000..727c42ddf --- /dev/null +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.ts @@ -0,0 +1,96 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "zigbeealliance.distributedcomplianceledger.pki"; + +export interface AllCertificatesBySubject { + subject: string; + subjectKeyIds: string[]; + schemaVersion: number; +} + +function createBaseAllCertificatesBySubject(): AllCertificatesBySubject { + return { subject: "", subjectKeyIds: [], schemaVersion: 0 }; +} + +export const AllCertificatesBySubject = { + encode(message: AllCertificatesBySubject, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + for (const v of message.subjectKeyIds) { + writer.uint32(18).string(v!); + } + if (message.schemaVersion !== 0) { + writer.uint32(24).uint32(message.schemaVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): AllCertificatesBySubject { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseAllCertificatesBySubject(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subject = reader.string(); + break; + case 2: + message.subjectKeyIds.push(reader.string()); + break; + case 3: + message.schemaVersion = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): AllCertificatesBySubject { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyIds: Array.isArray(object?.subjectKeyIds) ? object.subjectKeyIds.map((e: any) => String(e)) : [], + schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, + }; + }, + + toJSON(message: AllCertificatesBySubject): unknown { + const obj: any = {}; + message.subject !== undefined && (obj.subject = message.subject); + if (message.subjectKeyIds) { + obj.subjectKeyIds = message.subjectKeyIds.map((e) => e); + } else { + obj.subjectKeyIds = []; + } + message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); + return obj; + }, + + fromPartial, I>>(object: I): AllCertificatesBySubject { + const message = createBaseAllCertificatesBySubject(); + message.subject = object.subject ?? ""; + message.subjectKeyIds = object.subjectKeyIds?.map((e) => e) || []; + message.schemaVersion = object.schemaVersion ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/certificate.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/certificate.ts index edf0dec2a..ff3442b9f 100644 --- a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/certificate.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/certificate.ts @@ -4,6 +4,45 @@ import { Grant } from "./grant"; export const protobufPackage = "zigbeealliance.distributedcomplianceledger.pki"; +export enum CertificateType { + DeviceAttestationPKI = 0, + OperationalPKI = 1, + VIDSignerPKI = 2, + UNRECOGNIZED = -1, +} + +export function certificateTypeFromJSON(object: any): CertificateType { + switch (object) { + case 0: + case "DeviceAttestationPKI": + return CertificateType.DeviceAttestationPKI; + case 1: + case "OperationalPKI": + return CertificateType.OperationalPKI; + case 2: + case "VIDSignerPKI": + return CertificateType.VIDSignerPKI; + case -1: + case "UNRECOGNIZED": + default: + return CertificateType.UNRECOGNIZED; + } +} + +export function certificateTypeToJSON(object: CertificateType): string { + switch (object) { + case CertificateType.DeviceAttestationPKI: + return "DeviceAttestationPKI"; + case CertificateType.OperationalPKI: + return "OperationalPKI"; + case CertificateType.VIDSignerPKI: + return "VIDSignerPKI"; + case CertificateType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + export interface Certificate { pemCert: string; serialNumber: string; @@ -19,7 +58,7 @@ export interface Certificate { subjectAsText: string; rejects: Grant[]; vid: number; - isNoc: boolean; + certificateType: CertificateType; schemaVersion: number; } @@ -39,7 +78,7 @@ function createBaseCertificate(): Certificate { subjectAsText: "", rejects: [], vid: 0, - isNoc: false, + certificateType: 0, schemaVersion: 0, }; } @@ -88,8 +127,8 @@ export const Certificate = { if (message.vid !== 0) { writer.uint32(112).int32(message.vid); } - if (message.isNoc === true) { - writer.uint32(120).bool(message.isNoc); + if (message.certificateType !== 0) { + writer.uint32(120).int32(message.certificateType); } if (message.schemaVersion !== 0) { writer.uint32(128).uint32(message.schemaVersion); @@ -147,7 +186,7 @@ export const Certificate = { message.vid = reader.int32(); break; case 15: - message.isNoc = reader.bool(); + message.certificateType = reader.int32() as any; break; case 16: message.schemaVersion = reader.uint32(); @@ -176,7 +215,7 @@ export const Certificate = { subjectAsText: isSet(object.subjectAsText) ? String(object.subjectAsText) : "", rejects: Array.isArray(object?.rejects) ? object.rejects.map((e: any) => Grant.fromJSON(e)) : [], vid: isSet(object.vid) ? Number(object.vid) : 0, - isNoc: isSet(object.isNoc) ? Boolean(object.isNoc) : false, + certificateType: isSet(object.certificateType) ? certificateTypeFromJSON(object.certificateType) : 0, schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, }; }, @@ -205,7 +244,7 @@ export const Certificate = { obj.rejects = []; } message.vid !== undefined && (obj.vid = Math.round(message.vid)); - message.isNoc !== undefined && (obj.isNoc = message.isNoc); + message.certificateType !== undefined && (obj.certificateType = certificateTypeToJSON(message.certificateType)); message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); return obj; }, @@ -226,7 +265,7 @@ export const Certificate = { message.subjectAsText = object.subjectAsText ?? ""; message.rejects = object.rejects?.map((e) => Grant.fromPartial(e)) || []; message.vid = object.vid ?? 0; - message.isNoc = object.isNoc ?? false; + message.certificateType = object.certificateType ?? 0; message.schemaVersion = object.schemaVersion ?? 0; return message; }, diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/genesis.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/genesis.ts index 279824653..90deab7b4 100644 --- a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/genesis.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/genesis.ts @@ -1,19 +1,25 @@ /* eslint-disable */ import _m0 from "protobufjs/minimal"; +import { AllCertificates } from "./all_certificates"; +import { AllCertificatesBySubject } from "./all_certificates_by_subject"; import { ApprovedCertificates } from "./approved_certificates"; import { ApprovedCertificatesBySubject } from "./approved_certificates_by_subject"; import { ApprovedCertificatesBySubjectKeyId } from "./approved_certificates_by_subject_key_id"; import { ApprovedRootCertificates } from "./approved_root_certificates"; import { ChildCertificates } from "./child_certificates"; +import { NocCertificates } from "./noc_certificates"; +import { NocCertificatesBySubject } from "./noc_certificates_by_subject"; +import { NocCertificatesBySubjectKeyID } from "./noc_certificates_by_subject_key_id"; +import { NocCertificatesByVidAndSkid } from "./noc_certificates_by_vid_and_skid"; import { NocIcaCertificates } from "./noc_ica_certificates"; import { NocRootCertificates } from "./noc_root_certificates"; -import { NocRootCertificatesByVidAndSkid } from "./noc_root_certificates_by_vid_and_skid"; import { PkiRevocationDistributionPoint } from "./pki_revocation_distribution_point"; import { PkiRevocationDistributionPointsByIssuerSubjectKeyID } from "./pki_revocation_distribution_points_by_issuer_subject_key_id"; import { ProposedCertificate } from "./proposed_certificate"; import { ProposedCertificateRevocation } from "./proposed_certificate_revocation"; import { RejectedCertificate } from "./rejected_certificate"; import { RevokedCertificates } from "./revoked_certificates"; +import { RevokedNocIcaCertificates } from "./revoked_noc_ica_certificates"; import { RevokedNocRootCertificates } from "./revoked_noc_root_certificates"; import { RevokedRootCertificates } from "./revoked_root_certificates"; import { UniqueCertificate } from "./unique_certificate"; @@ -38,8 +44,14 @@ export interface GenesisState { nocRootCertificatesList: NocRootCertificates[]; nocIcaCertificatesList: NocIcaCertificates[]; revokedNocRootCertificatesList: RevokedNocRootCertificates[]; + nocCertificatesByVidAndSkidList: NocCertificatesByVidAndSkid[]; + NocCertificatesBySubjectKeyIDList: NocCertificatesBySubjectKeyID[]; + nocCertificatesList: NocCertificates[]; + nocCertificatesBySubjectList: NocCertificatesBySubject[]; + certificatesList: AllCertificates[]; + revokedNocIcaCertificatesList: RevokedNocIcaCertificates[]; /** this line is used by starport scaffolding # genesis/proto/state */ - nocRootCertificatesByVidAndSkidList: NocRootCertificatesByVidAndSkid[]; + allCertificatesBySubjectList: AllCertificatesBySubject[]; } function createBaseGenesisState(): GenesisState { @@ -60,7 +72,13 @@ function createBaseGenesisState(): GenesisState { nocRootCertificatesList: [], nocIcaCertificatesList: [], revokedNocRootCertificatesList: [], - nocRootCertificatesByVidAndSkidList: [], + nocCertificatesByVidAndSkidList: [], + NocCertificatesBySubjectKeyIDList: [], + nocCertificatesList: [], + nocCertificatesBySubjectList: [], + certificatesList: [], + revokedNocIcaCertificatesList: [], + allCertificatesBySubjectList: [], }; } @@ -114,8 +132,26 @@ export const GenesisState = { for (const v of message.revokedNocRootCertificatesList) { RevokedNocRootCertificates.encode(v!, writer.uint32(130).fork()).ldelim(); } - for (const v of message.nocRootCertificatesByVidAndSkidList) { - NocRootCertificatesByVidAndSkid.encode(v!, writer.uint32(138).fork()).ldelim(); + for (const v of message.nocCertificatesByVidAndSkidList) { + NocCertificatesByVidAndSkid.encode(v!, writer.uint32(138).fork()).ldelim(); + } + for (const v of message.NocCertificatesBySubjectKeyIDList) { + NocCertificatesBySubjectKeyID.encode(v!, writer.uint32(146).fork()).ldelim(); + } + for (const v of message.nocCertificatesList) { + NocCertificates.encode(v!, writer.uint32(154).fork()).ldelim(); + } + for (const v of message.nocCertificatesBySubjectList) { + NocCertificatesBySubject.encode(v!, writer.uint32(162).fork()).ldelim(); + } + for (const v of message.certificatesList) { + AllCertificates.encode(v!, writer.uint32(170).fork()).ldelim(); + } + for (const v of message.revokedNocIcaCertificatesList) { + RevokedNocIcaCertificates.encode(v!, writer.uint32(178).fork()).ldelim(); + } + for (const v of message.allCertificatesBySubjectList) { + AllCertificatesBySubject.encode(v!, writer.uint32(186).fork()).ldelim(); } return writer; }, @@ -182,9 +218,25 @@ export const GenesisState = { message.revokedNocRootCertificatesList.push(RevokedNocRootCertificates.decode(reader, reader.uint32())); break; case 17: - message.nocRootCertificatesByVidAndSkidList.push( - NocRootCertificatesByVidAndSkid.decode(reader, reader.uint32()), - ); + message.nocCertificatesByVidAndSkidList.push(NocCertificatesByVidAndSkid.decode(reader, reader.uint32())); + break; + case 18: + message.NocCertificatesBySubjectKeyIDList.push(NocCertificatesBySubjectKeyID.decode(reader, reader.uint32())); + break; + case 19: + message.nocCertificatesList.push(NocCertificates.decode(reader, reader.uint32())); + break; + case 20: + message.nocCertificatesBySubjectList.push(NocCertificatesBySubject.decode(reader, reader.uint32())); + break; + case 21: + message.certificatesList.push(AllCertificates.decode(reader, reader.uint32())); + break; + case 22: + message.revokedNocIcaCertificatesList.push(RevokedNocIcaCertificates.decode(reader, reader.uint32())); + break; + case 23: + message.allCertificatesBySubjectList.push(AllCertificatesBySubject.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -247,8 +299,26 @@ export const GenesisState = { revokedNocRootCertificatesList: Array.isArray(object?.revokedNocRootCertificatesList) ? object.revokedNocRootCertificatesList.map((e: any) => RevokedNocRootCertificates.fromJSON(e)) : [], - nocRootCertificatesByVidAndSkidList: Array.isArray(object?.nocRootCertificatesByVidAndSkidList) - ? object.nocRootCertificatesByVidAndSkidList.map((e: any) => NocRootCertificatesByVidAndSkid.fromJSON(e)) + nocCertificatesByVidAndSkidList: Array.isArray(object?.nocCertificatesByVidAndSkidList) + ? object.nocCertificatesByVidAndSkidList.map((e: any) => NocCertificatesByVidAndSkid.fromJSON(e)) + : [], + NocCertificatesBySubjectKeyIDList: Array.isArray(object?.NocCertificatesBySubjectKeyIDList) + ? object.NocCertificatesBySubjectKeyIDList.map((e: any) => NocCertificatesBySubjectKeyID.fromJSON(e)) + : [], + nocCertificatesList: Array.isArray(object?.nocCertificatesList) + ? object.nocCertificatesList.map((e: any) => NocCertificates.fromJSON(e)) + : [], + nocCertificatesBySubjectList: Array.isArray(object?.nocCertificatesBySubjectList) + ? object.nocCertificatesBySubjectList.map((e: any) => NocCertificatesBySubject.fromJSON(e)) + : [], + certificatesList: Array.isArray(object?.certificatesList) + ? object.certificatesList.map((e: any) => AllCertificates.fromJSON(e)) + : [], + revokedNocIcaCertificatesList: Array.isArray(object?.revokedNocIcaCertificatesList) + ? object.revokedNocIcaCertificatesList.map((e: any) => RevokedNocIcaCertificates.fromJSON(e)) + : [], + allCertificatesBySubjectList: Array.isArray(object?.allCertificatesBySubjectList) + ? object.allCertificatesBySubjectList.map((e: any) => AllCertificatesBySubject.fromJSON(e)) : [], }; }, @@ -356,12 +426,50 @@ export const GenesisState = { } else { obj.revokedNocRootCertificatesList = []; } - if (message.nocRootCertificatesByVidAndSkidList) { - obj.nocRootCertificatesByVidAndSkidList = message.nocRootCertificatesByVidAndSkidList.map((e) => - e ? NocRootCertificatesByVidAndSkid.toJSON(e) : undefined + if (message.nocCertificatesByVidAndSkidList) { + obj.nocCertificatesByVidAndSkidList = message.nocCertificatesByVidAndSkidList.map((e) => + e ? NocCertificatesByVidAndSkid.toJSON(e) : undefined + ); + } else { + obj.nocCertificatesByVidAndSkidList = []; + } + if (message.NocCertificatesBySubjectKeyIDList) { + obj.NocCertificatesBySubjectKeyIDList = message.NocCertificatesBySubjectKeyIDList.map((e) => + e ? NocCertificatesBySubjectKeyID.toJSON(e) : undefined + ); + } else { + obj.NocCertificatesBySubjectKeyIDList = []; + } + if (message.nocCertificatesList) { + obj.nocCertificatesList = message.nocCertificatesList.map((e) => e ? NocCertificates.toJSON(e) : undefined); + } else { + obj.nocCertificatesList = []; + } + if (message.nocCertificatesBySubjectList) { + obj.nocCertificatesBySubjectList = message.nocCertificatesBySubjectList.map((e) => + e ? NocCertificatesBySubject.toJSON(e) : undefined + ); + } else { + obj.nocCertificatesBySubjectList = []; + } + if (message.certificatesList) { + obj.certificatesList = message.certificatesList.map((e) => e ? AllCertificates.toJSON(e) : undefined); + } else { + obj.certificatesList = []; + } + if (message.revokedNocIcaCertificatesList) { + obj.revokedNocIcaCertificatesList = message.revokedNocIcaCertificatesList.map((e) => + e ? RevokedNocIcaCertificates.toJSON(e) : undefined + ); + } else { + obj.revokedNocIcaCertificatesList = []; + } + if (message.allCertificatesBySubjectList) { + obj.allCertificatesBySubjectList = message.allCertificatesBySubjectList.map((e) => + e ? AllCertificatesBySubject.toJSON(e) : undefined ); } else { - obj.nocRootCertificatesByVidAndSkidList = []; + obj.allCertificatesBySubjectList = []; } return obj; }, @@ -404,8 +512,18 @@ export const GenesisState = { message.nocIcaCertificatesList = object.nocIcaCertificatesList?.map((e) => NocIcaCertificates.fromPartial(e)) || []; message.revokedNocRootCertificatesList = object.revokedNocRootCertificatesList?.map((e) => RevokedNocRootCertificates.fromPartial(e)) || []; - message.nocRootCertificatesByVidAndSkidList = - object.nocRootCertificatesByVidAndSkidList?.map((e) => NocRootCertificatesByVidAndSkid.fromPartial(e)) || []; + message.nocCertificatesByVidAndSkidList = + object.nocCertificatesByVidAndSkidList?.map((e) => NocCertificatesByVidAndSkid.fromPartial(e)) || []; + message.NocCertificatesBySubjectKeyIDList = + object.NocCertificatesBySubjectKeyIDList?.map((e) => NocCertificatesBySubjectKeyID.fromPartial(e)) || []; + message.nocCertificatesList = object.nocCertificatesList?.map((e) => NocCertificates.fromPartial(e)) || []; + message.nocCertificatesBySubjectList = + object.nocCertificatesBySubjectList?.map((e) => NocCertificatesBySubject.fromPartial(e)) || []; + message.certificatesList = object.certificatesList?.map((e) => AllCertificates.fromPartial(e)) || []; + message.revokedNocIcaCertificatesList = + object.revokedNocIcaCertificatesList?.map((e) => RevokedNocIcaCertificates.fromPartial(e)) || []; + message.allCertificatesBySubjectList = + object.allCertificatesBySubjectList?.map((e) => AllCertificatesBySubject.fromPartial(e)) || []; return message; }, }; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates.ts index 199f4a0d4..1db6e1a9c 100644 --- a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates.ts @@ -5,21 +5,33 @@ import { Certificate } from "./certificate"; export const protobufPackage = "zigbeealliance.distributedcomplianceledger.pki"; export interface NocCertificates { - vid: number; + subject: string; + subjectKeyId: string; certs: Certificate[]; + tq: number; + schemaVersion: number; } function createBaseNocCertificates(): NocCertificates { - return { vid: 0, certs: [] }; + return { subject: "", subjectKeyId: "", certs: [], tq: 0, schemaVersion: 0 }; } export const NocCertificates = { encode(message: NocCertificates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.vid !== 0) { - writer.uint32(8).int32(message.vid); + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); } for (const v of message.certs) { - Certificate.encode(v!, writer.uint32(18).fork()).ldelim(); + Certificate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.tq !== 0) { + writer.uint32(37).float(message.tq); + } + if (message.schemaVersion !== 0) { + writer.uint32(40).uint32(message.schemaVersion); } return writer; }, @@ -32,11 +44,20 @@ export const NocCertificates = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.vid = reader.int32(); + message.subject = reader.string(); break; case 2: + message.subjectKeyId = reader.string(); + break; + case 3: message.certs.push(Certificate.decode(reader, reader.uint32())); break; + case 4: + message.tq = reader.float(); + break; + case 5: + message.schemaVersion = reader.uint32(); + break; default: reader.skipType(tag & 7); break; @@ -47,26 +68,35 @@ export const NocCertificates = { fromJSON(object: any): NocCertificates { return { - vid: isSet(object.vid) ? Number(object.vid) : 0, + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", certs: Array.isArray(object?.certs) ? object.certs.map((e: any) => Certificate.fromJSON(e)) : [], + tq: isSet(object.tq) ? Number(object.tq) : 0, + schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, }; }, toJSON(message: NocCertificates): unknown { const obj: any = {}; - message.vid !== undefined && (obj.vid = Math.round(message.vid)); + message.subject !== undefined && (obj.subject = message.subject); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); if (message.certs) { obj.certs = message.certs.map((e) => e ? Certificate.toJSON(e) : undefined); } else { obj.certs = []; } + message.tq !== undefined && (obj.tq = message.tq); + message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); return obj; }, fromPartial, I>>(object: I): NocCertificates { const message = createBaseNocCertificates(); - message.vid = object.vid ?? 0; + message.subject = object.subject ?? ""; + message.subjectKeyId = object.subjectKeyId ?? ""; message.certs = object.certs?.map((e) => Certificate.fromPartial(e)) || []; + message.tq = object.tq ?? 0; + message.schemaVersion = object.schemaVersion ?? 0; return message; }, }; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject.ts new file mode 100644 index 000000000..44172db1b --- /dev/null +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject.ts @@ -0,0 +1,96 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "zigbeealliance.distributedcomplianceledger.pki"; + +export interface NocCertificatesBySubject { + subject: string; + subjectKeyIds: string[]; + schemaVersion: number; +} + +function createBaseNocCertificatesBySubject(): NocCertificatesBySubject { + return { subject: "", subjectKeyIds: [], schemaVersion: 0 }; +} + +export const NocCertificatesBySubject = { + encode(message: NocCertificatesBySubject, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + for (const v of message.subjectKeyIds) { + writer.uint32(18).string(v!); + } + if (message.schemaVersion !== 0) { + writer.uint32(24).uint32(message.schemaVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NocCertificatesBySubject { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNocCertificatesBySubject(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subject = reader.string(); + break; + case 2: + message.subjectKeyIds.push(reader.string()); + break; + case 3: + message.schemaVersion = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NocCertificatesBySubject { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyIds: Array.isArray(object?.subjectKeyIds) ? object.subjectKeyIds.map((e: any) => String(e)) : [], + schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, + }; + }, + + toJSON(message: NocCertificatesBySubject): unknown { + const obj: any = {}; + message.subject !== undefined && (obj.subject = message.subject); + if (message.subjectKeyIds) { + obj.subjectKeyIds = message.subjectKeyIds.map((e) => e); + } else { + obj.subjectKeyIds = []; + } + message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); + return obj; + }, + + fromPartial, I>>(object: I): NocCertificatesBySubject { + const message = createBaseNocCertificatesBySubject(); + message.subject = object.subject ?? ""; + message.subjectKeyIds = object.subjectKeyIds?.map((e) => e) || []; + message.schemaVersion = object.schemaVersion ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject_key_id.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject_key_id.ts new file mode 100644 index 000000000..7156597ff --- /dev/null +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_subject_key_id.ts @@ -0,0 +1,109 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Certificate } from "./certificate"; + +export const protobufPackage = "zigbeealliance.distributedcomplianceledger.pki"; + +export interface NocCertificatesBySubjectKeyID { + subjectKeyId: string; + certs: Certificate[]; + tq: number; + schemaVersion: number; +} + +function createBaseNocCertificatesBySubjectKeyID(): NocCertificatesBySubjectKeyID { + return { subjectKeyId: "", certs: [], tq: 0, schemaVersion: 0 }; +} + +export const NocCertificatesBySubjectKeyID = { + encode(message: NocCertificatesBySubjectKeyID, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subjectKeyId !== "") { + writer.uint32(10).string(message.subjectKeyId); + } + for (const v of message.certs) { + Certificate.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.tq !== 0) { + writer.uint32(29).float(message.tq); + } + if (message.schemaVersion !== 0) { + writer.uint32(32).uint32(message.schemaVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NocCertificatesBySubjectKeyID { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNocCertificatesBySubjectKeyID(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subjectKeyId = reader.string(); + break; + case 2: + message.certs.push(Certificate.decode(reader, reader.uint32())); + break; + case 3: + message.tq = reader.float(); + break; + case 4: + message.schemaVersion = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NocCertificatesBySubjectKeyID { + return { + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + certs: Array.isArray(object?.certs) ? object.certs.map((e: any) => Certificate.fromJSON(e)) : [], + tq: isSet(object.tq) ? Number(object.tq) : 0, + schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, + }; + }, + + toJSON(message: NocCertificatesBySubjectKeyID): unknown { + const obj: any = {}; + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + if (message.certs) { + obj.certs = message.certs.map((e) => e ? Certificate.toJSON(e) : undefined); + } else { + obj.certs = []; + } + message.tq !== undefined && (obj.tq = message.tq); + message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); + return obj; + }, + + fromPartial, I>>( + object: I, + ): NocCertificatesBySubjectKeyID { + const message = createBaseNocCertificatesBySubjectKeyID(); + message.subjectKeyId = object.subjectKeyId ?? ""; + message.certs = object.certs?.map((e) => Certificate.fromPartial(e)) || []; + message.tq = object.tq ?? 0; + message.schemaVersion = object.schemaVersion ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_vid_and_skid.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_vid_and_skid.ts new file mode 100644 index 000000000..5c43b460b --- /dev/null +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/noc_certificates_by_vid_and_skid.ts @@ -0,0 +1,117 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Certificate } from "./certificate"; + +export const protobufPackage = "zigbeealliance.distributedcomplianceledger.pki"; + +export interface NocCertificatesByVidAndSkid { + vid: number; + subjectKeyId: string; + certs: Certificate[]; + tq: number; + schemaVersion: number; +} + +function createBaseNocCertificatesByVidAndSkid(): NocCertificatesByVidAndSkid { + return { vid: 0, subjectKeyId: "", certs: [], tq: 0, schemaVersion: 0 }; +} + +export const NocCertificatesByVidAndSkid = { + encode(message: NocCertificatesByVidAndSkid, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.vid !== 0) { + writer.uint32(8).int32(message.vid); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); + } + for (const v of message.certs) { + Certificate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.tq !== 0) { + writer.uint32(37).float(message.tq); + } + if (message.schemaVersion !== 0) { + writer.uint32(40).uint32(message.schemaVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NocCertificatesByVidAndSkid { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNocCertificatesByVidAndSkid(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vid = reader.int32(); + break; + case 2: + message.subjectKeyId = reader.string(); + break; + case 3: + message.certs.push(Certificate.decode(reader, reader.uint32())); + break; + case 4: + message.tq = reader.float(); + break; + case 5: + message.schemaVersion = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NocCertificatesByVidAndSkid { + return { + vid: isSet(object.vid) ? Number(object.vid) : 0, + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + certs: Array.isArray(object?.certs) ? object.certs.map((e: any) => Certificate.fromJSON(e)) : [], + tq: isSet(object.tq) ? Number(object.tq) : 0, + schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, + }; + }, + + toJSON(message: NocCertificatesByVidAndSkid): unknown { + const obj: any = {}; + message.vid !== undefined && (obj.vid = Math.round(message.vid)); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + if (message.certs) { + obj.certs = message.certs.map((e) => e ? Certificate.toJSON(e) : undefined); + } else { + obj.certs = []; + } + message.tq !== undefined && (obj.tq = message.tq); + message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); + return obj; + }, + + fromPartial, I>>(object: I): NocCertificatesByVidAndSkid { + const message = createBaseNocCertificatesByVidAndSkid(); + message.vid = object.vid ?? 0; + message.subjectKeyId = object.subjectKeyId ?? ""; + message.certs = object.certs?.map((e) => Certificate.fromPartial(e)) || []; + message.tq = object.tq ?? 0; + message.schemaVersion = object.schemaVersion ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/query.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/query.ts index 9471c3597..fde7bf85e 100644 --- a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/query.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/query.ts @@ -1,24 +1,55 @@ /* eslint-disable */ import _m0 from "protobufjs/minimal"; import { PageRequest, PageResponse } from "../../../cosmos/base/query/v1beta1/pagination"; +import { AllCertificates } from "./all_certificates"; +import { AllCertificatesBySubject } from "./all_certificates_by_subject"; import { ApprovedCertificates } from "./approved_certificates"; import { ApprovedCertificatesBySubject } from "./approved_certificates_by_subject"; import { ApprovedRootCertificates } from "./approved_root_certificates"; import { ChildCertificates } from "./child_certificates"; +import { NocCertificates } from "./noc_certificates"; +import { NocCertificatesBySubject } from "./noc_certificates_by_subject"; +import { NocCertificatesByVidAndSkid } from "./noc_certificates_by_vid_and_skid"; import { NocIcaCertificates } from "./noc_ica_certificates"; import { NocRootCertificates } from "./noc_root_certificates"; -import { NocRootCertificatesByVidAndSkid } from "./noc_root_certificates_by_vid_and_skid"; import { PkiRevocationDistributionPoint } from "./pki_revocation_distribution_point"; import { PkiRevocationDistributionPointsByIssuerSubjectKeyID } from "./pki_revocation_distribution_points_by_issuer_subject_key_id"; import { ProposedCertificate } from "./proposed_certificate"; import { ProposedCertificateRevocation } from "./proposed_certificate_revocation"; import { RejectedCertificate } from "./rejected_certificate"; import { RevokedCertificates } from "./revoked_certificates"; +import { RevokedNocIcaCertificates } from "./revoked_noc_ica_certificates"; import { RevokedNocRootCertificates } from "./revoked_noc_root_certificates"; import { RevokedRootCertificates } from "./revoked_root_certificates"; export const protobufPackage = "zigbeealliance.distributedcomplianceledger.pki"; +export interface QueryAllCertificatesRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllCertificatesResponse { + certificates: AllCertificates[]; + pagination: PageResponse | undefined; +} + +export interface QueryGetAllCertificatesBySubjectRequest { + subject: string; +} + +export interface QueryGetAllCertificatesBySubjectResponse { + allCertificatesBySubject: AllCertificatesBySubject | undefined; +} + +export interface QueryGetCertificatesRequest { + subject: string; + subjectKeyId: string; +} + +export interface QueryGetCertificatesResponse { + certificates: AllCertificates | undefined; +} + export interface QueryGetApprovedCertificatesRequest { subject: string; subjectKeyId: string; @@ -221,42 +252,81 @@ export interface QueryAllRevokedNocRootCertificatesResponse { pagination: PageResponse | undefined; } -export interface QueryGetNocRootCertificatesByVidAndSkidRequest { +export interface QueryGetRevokedNocIcaCertificatesRequest { + subject: string; + subjectKeyId: string; +} + +export interface QueryGetRevokedNocIcaCertificatesResponse { + revokedNocIcaCertificates: RevokedNocIcaCertificates | undefined; +} + +export interface QueryAllRevokedNocIcaCertificatesRequest { + pagination: PageRequest | undefined; +} + +export interface QueryAllRevokedNocIcaCertificatesResponse { + revokedNocIcaCertificates: RevokedNocIcaCertificates[]; + pagination: PageResponse | undefined; +} + +export interface QueryGetNocCertificatesByVidAndSkidRequest { vid: number; subjectKeyId: string; } -export interface QueryGetNocRootCertificatesByVidAndSkidResponse { - nocRootCertificatesByVidAndSkid: NocRootCertificatesByVidAndSkid | undefined; +export interface QueryGetNocCertificatesByVidAndSkidResponse { + nocCertificatesByVidAndSkid: NocCertificatesByVidAndSkid | undefined; } -function createBaseQueryGetApprovedCertificatesRequest(): QueryGetApprovedCertificatesRequest { - return { subject: "", subjectKeyId: "" }; +export interface QueryNocCertificatesRequest { + pagination: PageRequest | undefined; + subjectKeyId: string; } -export const QueryGetApprovedCertificatesRequest = { - encode(message: QueryGetApprovedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.subject !== "") { - writer.uint32(10).string(message.subject); - } - if (message.subjectKeyId !== "") { - writer.uint32(18).string(message.subjectKeyId); +export interface QueryNocCertificatesResponse { + nocCertificates: NocCertificates[]; + pagination: PageResponse | undefined; +} + +export interface QueryGetNocCertificatesBySubjectRequest { + subject: string; +} + +export interface QueryGetNocCertificatesBySubjectResponse { + nocCertificatesBySubject: NocCertificatesBySubject | undefined; +} + +export interface QueryGetNocCertificatesRequest { + subject: string; + subjectKeyId: string; +} + +export interface QueryGetNocCertificatesResponse { + nocCertificates: NocCertificates | undefined; +} + +function createBaseQueryAllCertificatesRequest(): QueryAllCertificatesRequest { + return { pagination: undefined }; +} + +export const QueryAllCertificatesRequest = { + encode(message: QueryAllCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetApprovedCertificatesRequest(); + const message = createBaseQueryAllCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.subject = reader.string(); - break; - case 2: - message.subjectKeyId = reader.string(); + message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -266,51 +336,53 @@ export const QueryGetApprovedCertificatesRequest = { return message; }, - fromJSON(object: any): QueryGetApprovedCertificatesRequest { - return { - subject: isSet(object.subject) ? String(object.subject) : "", - subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", - }; + fromJSON(object: any): QueryAllCertificatesRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, - toJSON(message: QueryGetApprovedCertificatesRequest): unknown { + toJSON(message: QueryAllCertificatesRequest): unknown { const obj: any = {}; - message.subject !== undefined && (obj.subject = message.subject); - message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGetApprovedCertificatesRequest { - const message = createBaseQueryGetApprovedCertificatesRequest(); - message.subject = object.subject ?? ""; - message.subjectKeyId = object.subjectKeyId ?? ""; + fromPartial, I>>(object: I): QueryAllCertificatesRequest { + const message = createBaseQueryAllCertificatesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseQueryGetApprovedCertificatesResponse(): QueryGetApprovedCertificatesResponse { - return { approvedCertificates: undefined }; +function createBaseQueryAllCertificatesResponse(): QueryAllCertificatesResponse { + return { certificates: [], pagination: undefined }; } -export const QueryGetApprovedCertificatesResponse = { - encode(message: QueryGetApprovedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.approvedCertificates !== undefined) { - ApprovedCertificates.encode(message.approvedCertificates, writer.uint32(10).fork()).ldelim(); +export const QueryAllCertificatesResponse = { + encode(message: QueryAllCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.certificates) { + AllCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetApprovedCertificatesResponse(); + const message = createBaseQueryAllCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.approvedCertificates = ApprovedCertificates.decode(reader, reader.uint32()); + message.certificates.push(AllCertificates.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -320,60 +392,58 @@ export const QueryGetApprovedCertificatesResponse = { return message; }, - fromJSON(object: any): QueryGetApprovedCertificatesResponse { + fromJSON(object: any): QueryAllCertificatesResponse { return { - approvedCertificates: isSet(object.approvedCertificates) - ? ApprovedCertificates.fromJSON(object.approvedCertificates) - : undefined, + certificates: Array.isArray(object?.certificates) + ? object.certificates.map((e: any) => AllCertificates.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: QueryGetApprovedCertificatesResponse): unknown { + toJSON(message: QueryAllCertificatesResponse): unknown { const obj: any = {}; - message.approvedCertificates !== undefined && (obj.approvedCertificates = message.approvedCertificates - ? ApprovedCertificates.toJSON(message.approvedCertificates) - : undefined); + if (message.certificates) { + obj.certificates = message.certificates.map((e) => e ? AllCertificates.toJSON(e) : undefined); + } else { + obj.certificates = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGetApprovedCertificatesResponse { - const message = createBaseQueryGetApprovedCertificatesResponse(); - message.approvedCertificates = (object.approvedCertificates !== undefined && object.approvedCertificates !== null) - ? ApprovedCertificates.fromPartial(object.approvedCertificates) + fromPartial, I>>(object: I): QueryAllCertificatesResponse { + const message = createBaseQueryAllCertificatesResponse(); + message.certificates = object.certificates?.map((e) => AllCertificates.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, }; -function createBaseQueryAllApprovedCertificatesRequest(): QueryAllApprovedCertificatesRequest { - return { pagination: undefined, subjectKeyId: "" }; +function createBaseQueryGetAllCertificatesBySubjectRequest(): QueryGetAllCertificatesBySubjectRequest { + return { subject: "" }; } -export const QueryAllApprovedCertificatesRequest = { - encode(message: QueryAllApprovedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } - if (message.subjectKeyId !== "") { - writer.uint32(18).string(message.subjectKeyId); +export const QueryGetAllCertificatesBySubjectRequest = { + encode(message: QueryGetAllCertificatesBySubjectRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllApprovedCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetAllCertificatesBySubjectRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllApprovedCertificatesRequest(); + const message = createBaseQueryGetAllCertificatesBySubjectRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; - case 2: - message.subjectKeyId = reader.string(); + message.subject = reader.string(); break; default: reader.skipType(tag & 7); @@ -383,60 +453,46 @@ export const QueryAllApprovedCertificatesRequest = { return message; }, - fromJSON(object: any): QueryAllApprovedCertificatesRequest { - return { - pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, - subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", - }; + fromJSON(object: any): QueryGetAllCertificatesBySubjectRequest { + return { subject: isSet(object.subject) ? String(object.subject) : "" }; }, - toJSON(message: QueryAllApprovedCertificatesRequest): unknown { + toJSON(message: QueryGetAllCertificatesBySubjectRequest): unknown { const obj: any = {}; - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); - message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + message.subject !== undefined && (obj.subject = message.subject); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllApprovedCertificatesRequest { - const message = createBaseQueryAllApprovedCertificatesRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; - message.subjectKeyId = object.subjectKeyId ?? ""; + ): QueryGetAllCertificatesBySubjectRequest { + const message = createBaseQueryGetAllCertificatesBySubjectRequest(); + message.subject = object.subject ?? ""; return message; }, }; -function createBaseQueryAllApprovedCertificatesResponse(): QueryAllApprovedCertificatesResponse { - return { approvedCertificates: [], pagination: undefined }; +function createBaseQueryGetAllCertificatesBySubjectResponse(): QueryGetAllCertificatesBySubjectResponse { + return { allCertificatesBySubject: undefined }; } -export const QueryAllApprovedCertificatesResponse = { - encode(message: QueryAllApprovedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.approvedCertificates) { - ApprovedCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); +export const QueryGetAllCertificatesBySubjectResponse = { + encode(message: QueryGetAllCertificatesBySubjectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.allCertificatesBySubject !== undefined) { + AllCertificatesBySubject.encode(message.allCertificatesBySubject, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllApprovedCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetAllCertificatesBySubjectResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllApprovedCertificatesResponse(); + const message = createBaseQueryGetAllCertificatesBySubjectResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.approvedCertificates.push(ApprovedCertificates.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); + message.allCertificatesBySubject = AllCertificatesBySubject.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -446,47 +502,40 @@ export const QueryAllApprovedCertificatesResponse = { return message; }, - fromJSON(object: any): QueryAllApprovedCertificatesResponse { + fromJSON(object: any): QueryGetAllCertificatesBySubjectResponse { return { - approvedCertificates: Array.isArray(object?.approvedCertificates) - ? object.approvedCertificates.map((e: any) => ApprovedCertificates.fromJSON(e)) - : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + allCertificatesBySubject: isSet(object.allCertificatesBySubject) + ? AllCertificatesBySubject.fromJSON(object.allCertificatesBySubject) + : undefined, }; }, - toJSON(message: QueryAllApprovedCertificatesResponse): unknown { + toJSON(message: QueryGetAllCertificatesBySubjectResponse): unknown { const obj: any = {}; - if (message.approvedCertificates) { - obj.approvedCertificates = message.approvedCertificates.map((e) => - e ? ApprovedCertificates.toJSON(e) : undefined - ); - } else { - obj.approvedCertificates = []; - } - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.allCertificatesBySubject !== undefined && (obj.allCertificatesBySubject = message.allCertificatesBySubject + ? AllCertificatesBySubject.toJSON(message.allCertificatesBySubject) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllApprovedCertificatesResponse { - const message = createBaseQueryAllApprovedCertificatesResponse(); - message.approvedCertificates = object.approvedCertificates?.map((e) => ApprovedCertificates.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; + ): QueryGetAllCertificatesBySubjectResponse { + const message = createBaseQueryGetAllCertificatesBySubjectResponse(); + message.allCertificatesBySubject = + (object.allCertificatesBySubject !== undefined && object.allCertificatesBySubject !== null) + ? AllCertificatesBySubject.fromPartial(object.allCertificatesBySubject) + : undefined; return message; }, }; -function createBaseQueryGetProposedCertificateRequest(): QueryGetProposedCertificateRequest { +function createBaseQueryGetCertificatesRequest(): QueryGetCertificatesRequest { return { subject: "", subjectKeyId: "" }; } -export const QueryGetProposedCertificateRequest = { - encode(message: QueryGetProposedCertificateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryGetCertificatesRequest = { + encode(message: QueryGetCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.subject !== "") { writer.uint32(10).string(message.subject); } @@ -496,10 +545,10 @@ export const QueryGetProposedCertificateRequest = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetProposedCertificateRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProposedCertificateRequest(); + const message = createBaseQueryGetCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -517,51 +566,49 @@ export const QueryGetProposedCertificateRequest = { return message; }, - fromJSON(object: any): QueryGetProposedCertificateRequest { + fromJSON(object: any): QueryGetCertificatesRequest { return { subject: isSet(object.subject) ? String(object.subject) : "", subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", }; }, - toJSON(message: QueryGetProposedCertificateRequest): unknown { + toJSON(message: QueryGetCertificatesRequest): unknown { const obj: any = {}; message.subject !== undefined && (obj.subject = message.subject); message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGetProposedCertificateRequest { - const message = createBaseQueryGetProposedCertificateRequest(); + fromPartial, I>>(object: I): QueryGetCertificatesRequest { + const message = createBaseQueryGetCertificatesRequest(); message.subject = object.subject ?? ""; message.subjectKeyId = object.subjectKeyId ?? ""; return message; }, }; -function createBaseQueryGetProposedCertificateResponse(): QueryGetProposedCertificateResponse { - return { proposedCertificate: undefined }; +function createBaseQueryGetCertificatesResponse(): QueryGetCertificatesResponse { + return { certificates: undefined }; } -export const QueryGetProposedCertificateResponse = { - encode(message: QueryGetProposedCertificateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.proposedCertificate !== undefined) { - ProposedCertificate.encode(message.proposedCertificate, writer.uint32(10).fork()).ldelim(); +export const QueryGetCertificatesResponse = { + encode(message: QueryGetCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.certificates !== undefined) { + AllCertificates.encode(message.certificates, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetProposedCertificateResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProposedCertificateResponse(); + const message = createBaseQueryGetCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposedCertificate = ProposedCertificate.decode(reader, reader.uint32()); + message.certificates = AllCertificates.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -571,54 +618,53 @@ export const QueryGetProposedCertificateResponse = { return message; }, - fromJSON(object: any): QueryGetProposedCertificateResponse { - return { - proposedCertificate: isSet(object.proposedCertificate) - ? ProposedCertificate.fromJSON(object.proposedCertificate) - : undefined, - }; + fromJSON(object: any): QueryGetCertificatesResponse { + return { certificates: isSet(object.certificates) ? AllCertificates.fromJSON(object.certificates) : undefined }; }, - toJSON(message: QueryGetProposedCertificateResponse): unknown { + toJSON(message: QueryGetCertificatesResponse): unknown { const obj: any = {}; - message.proposedCertificate !== undefined && (obj.proposedCertificate = message.proposedCertificate - ? ProposedCertificate.toJSON(message.proposedCertificate) - : undefined); + message.certificates !== undefined + && (obj.certificates = message.certificates ? AllCertificates.toJSON(message.certificates) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGetProposedCertificateResponse { - const message = createBaseQueryGetProposedCertificateResponse(); - message.proposedCertificate = (object.proposedCertificate !== undefined && object.proposedCertificate !== null) - ? ProposedCertificate.fromPartial(object.proposedCertificate) + fromPartial, I>>(object: I): QueryGetCertificatesResponse { + const message = createBaseQueryGetCertificatesResponse(); + message.certificates = (object.certificates !== undefined && object.certificates !== null) + ? AllCertificates.fromPartial(object.certificates) : undefined; return message; }, }; -function createBaseQueryAllProposedCertificateRequest(): QueryAllProposedCertificateRequest { - return { pagination: undefined }; +function createBaseQueryGetApprovedCertificatesRequest(): QueryGetApprovedCertificatesRequest { + return { subject: "", subjectKeyId: "" }; } -export const QueryAllProposedCertificateRequest = { - encode(message: QueryAllProposedCertificateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); +export const QueryGetApprovedCertificatesRequest = { + encode(message: QueryGetApprovedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllProposedCertificateRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllProposedCertificateRequest(); + const message = createBaseQueryGetApprovedCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); + message.subject = reader.string(); + break; + case 2: + message.subjectKeyId = reader.string(); break; default: reader.skipType(tag & 7); @@ -628,55 +674,51 @@ export const QueryAllProposedCertificateRequest = { return message; }, - fromJSON(object: any): QueryAllProposedCertificateRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + fromJSON(object: any): QueryGetApprovedCertificatesRequest { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + }; }, - toJSON(message: QueryAllProposedCertificateRequest): unknown { + toJSON(message: QueryGetApprovedCertificatesRequest): unknown { const obj: any = {}; - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.subject !== undefined && (obj.subject = message.subject); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllProposedCertificateRequest { - const message = createBaseQueryAllProposedCertificateRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; + ): QueryGetApprovedCertificatesRequest { + const message = createBaseQueryGetApprovedCertificatesRequest(); + message.subject = object.subject ?? ""; + message.subjectKeyId = object.subjectKeyId ?? ""; return message; }, }; -function createBaseQueryAllProposedCertificateResponse(): QueryAllProposedCertificateResponse { - return { proposedCertificate: [], pagination: undefined }; +function createBaseQueryGetApprovedCertificatesResponse(): QueryGetApprovedCertificatesResponse { + return { approvedCertificates: undefined }; } -export const QueryAllProposedCertificateResponse = { - encode(message: QueryAllProposedCertificateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.proposedCertificate) { - ProposedCertificate.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); +export const QueryGetApprovedCertificatesResponse = { + encode(message: QueryGetApprovedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.approvedCertificates !== undefined) { + ApprovedCertificates.encode(message.approvedCertificates, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllProposedCertificateResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllProposedCertificateResponse(); + const message = createBaseQueryGetApprovedCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposedCertificate.push(ProposedCertificate.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); + message.approvedCertificates = ApprovedCertificates.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -686,66 +728,60 @@ export const QueryAllProposedCertificateResponse = { return message; }, - fromJSON(object: any): QueryAllProposedCertificateResponse { + fromJSON(object: any): QueryGetApprovedCertificatesResponse { return { - proposedCertificate: Array.isArray(object?.proposedCertificate) - ? object.proposedCertificate.map((e: any) => ProposedCertificate.fromJSON(e)) - : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + approvedCertificates: isSet(object.approvedCertificates) + ? ApprovedCertificates.fromJSON(object.approvedCertificates) + : undefined, }; }, - toJSON(message: QueryAllProposedCertificateResponse): unknown { + toJSON(message: QueryGetApprovedCertificatesResponse): unknown { const obj: any = {}; - if (message.proposedCertificate) { - obj.proposedCertificate = message.proposedCertificate.map((e) => e ? ProposedCertificate.toJSON(e) : undefined); - } else { - obj.proposedCertificate = []; - } - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.approvedCertificates !== undefined && (obj.approvedCertificates = message.approvedCertificates + ? ApprovedCertificates.toJSON(message.approvedCertificates) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllProposedCertificateResponse { - const message = createBaseQueryAllProposedCertificateResponse(); - message.proposedCertificate = object.proposedCertificate?.map((e) => ProposedCertificate.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) + ): QueryGetApprovedCertificatesResponse { + const message = createBaseQueryGetApprovedCertificatesResponse(); + message.approvedCertificates = (object.approvedCertificates !== undefined && object.approvedCertificates !== null) + ? ApprovedCertificates.fromPartial(object.approvedCertificates) : undefined; return message; }, }; -function createBaseQueryGetChildCertificatesRequest(): QueryGetChildCertificatesRequest { - return { issuer: "", authorityKeyId: "" }; +function createBaseQueryAllApprovedCertificatesRequest(): QueryAllApprovedCertificatesRequest { + return { pagination: undefined, subjectKeyId: "" }; } -export const QueryGetChildCertificatesRequest = { - encode(message: QueryGetChildCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.issuer !== "") { - writer.uint32(10).string(message.issuer); +export const QueryAllApprovedCertificatesRequest = { + encode(message: QueryAllApprovedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } - if (message.authorityKeyId !== "") { - writer.uint32(18).string(message.authorityKeyId); + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetChildCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllApprovedCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetChildCertificatesRequest(); + const message = createBaseQueryAllApprovedCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.issuer = reader.string(); + message.pagination = PageRequest.decode(reader, reader.uint32()); break; case 2: - message.authorityKeyId = reader.string(); + message.subjectKeyId = reader.string(); break; default: reader.skipType(tag & 7); @@ -755,51 +791,60 @@ export const QueryGetChildCertificatesRequest = { return message; }, - fromJSON(object: any): QueryGetChildCertificatesRequest { + fromJSON(object: any): QueryAllApprovedCertificatesRequest { return { - issuer: isSet(object.issuer) ? String(object.issuer) : "", - authorityKeyId: isSet(object.authorityKeyId) ? String(object.authorityKeyId) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", }; }, - toJSON(message: QueryGetChildCertificatesRequest): unknown { + toJSON(message: QueryAllApprovedCertificatesRequest): unknown { const obj: any = {}; - message.issuer !== undefined && (obj.issuer = message.issuer); - message.authorityKeyId !== undefined && (obj.authorityKeyId = message.authorityKeyId); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetChildCertificatesRequest { - const message = createBaseQueryGetChildCertificatesRequest(); - message.issuer = object.issuer ?? ""; - message.authorityKeyId = object.authorityKeyId ?? ""; + ): QueryAllApprovedCertificatesRequest { + const message = createBaseQueryAllApprovedCertificatesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + message.subjectKeyId = object.subjectKeyId ?? ""; return message; }, }; -function createBaseQueryGetChildCertificatesResponse(): QueryGetChildCertificatesResponse { - return { childCertificates: undefined }; +function createBaseQueryAllApprovedCertificatesResponse(): QueryAllApprovedCertificatesResponse { + return { approvedCertificates: [], pagination: undefined }; } -export const QueryGetChildCertificatesResponse = { - encode(message: QueryGetChildCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.childCertificates !== undefined) { - ChildCertificates.encode(message.childCertificates, writer.uint32(10).fork()).ldelim(); +export const QueryAllApprovedCertificatesResponse = { + encode(message: QueryAllApprovedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.approvedCertificates) { + ApprovedCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetChildCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllApprovedCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetChildCertificatesResponse(); + const message = createBaseQueryAllApprovedCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.childCertificates = ChildCertificates.decode(reader, reader.uint32()); + message.approvedCertificates.push(ApprovedCertificates.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -809,55 +854,60 @@ export const QueryGetChildCertificatesResponse = { return message; }, - fromJSON(object: any): QueryGetChildCertificatesResponse { + fromJSON(object: any): QueryAllApprovedCertificatesResponse { return { - childCertificates: isSet(object.childCertificates) - ? ChildCertificates.fromJSON(object.childCertificates) - : undefined, + approvedCertificates: Array.isArray(object?.approvedCertificates) + ? object.approvedCertificates.map((e: any) => ApprovedCertificates.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: QueryGetChildCertificatesResponse): unknown { + toJSON(message: QueryAllApprovedCertificatesResponse): unknown { const obj: any = {}; - message.childCertificates !== undefined && (obj.childCertificates = message.childCertificates - ? ChildCertificates.toJSON(message.childCertificates) - : undefined); + if (message.approvedCertificates) { + obj.approvedCertificates = message.approvedCertificates.map((e) => + e ? ApprovedCertificates.toJSON(e) : undefined + ); + } else { + obj.approvedCertificates = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetChildCertificatesResponse { - const message = createBaseQueryGetChildCertificatesResponse(); - message.childCertificates = (object.childCertificates !== undefined && object.childCertificates !== null) - ? ChildCertificates.fromPartial(object.childCertificates) + ): QueryAllApprovedCertificatesResponse { + const message = createBaseQueryAllApprovedCertificatesResponse(); + message.approvedCertificates = object.approvedCertificates?.map((e) => ApprovedCertificates.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) : undefined; return message; }, }; -function createBaseQueryGetProposedCertificateRevocationRequest(): QueryGetProposedCertificateRevocationRequest { - return { subject: "", subjectKeyId: "", serialNumber: "" }; +function createBaseQueryGetProposedCertificateRequest(): QueryGetProposedCertificateRequest { + return { subject: "", subjectKeyId: "" }; } -export const QueryGetProposedCertificateRevocationRequest = { - encode(message: QueryGetProposedCertificateRevocationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryGetProposedCertificateRequest = { + encode(message: QueryGetProposedCertificateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.subject !== "") { writer.uint32(10).string(message.subject); } if (message.subjectKeyId !== "") { writer.uint32(18).string(message.subjectKeyId); } - if (message.serialNumber !== "") { - writer.uint32(26).string(message.serialNumber); - } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetProposedCertificateRevocationRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetProposedCertificateRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProposedCertificateRevocationRequest(); + const message = createBaseQueryGetProposedCertificateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -867,9 +917,6 @@ export const QueryGetProposedCertificateRevocationRequest = { case 2: message.subjectKeyId = reader.string(); break; - case 3: - message.serialNumber = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -878,54 +925,51 @@ export const QueryGetProposedCertificateRevocationRequest = { return message; }, - fromJSON(object: any): QueryGetProposedCertificateRevocationRequest { + fromJSON(object: any): QueryGetProposedCertificateRequest { return { subject: isSet(object.subject) ? String(object.subject) : "", subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", - serialNumber: isSet(object.serialNumber) ? String(object.serialNumber) : "", }; }, - toJSON(message: QueryGetProposedCertificateRevocationRequest): unknown { + toJSON(message: QueryGetProposedCertificateRequest): unknown { const obj: any = {}; message.subject !== undefined && (obj.subject = message.subject); message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); - message.serialNumber !== undefined && (obj.serialNumber = message.serialNumber); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetProposedCertificateRevocationRequest { - const message = createBaseQueryGetProposedCertificateRevocationRequest(); + ): QueryGetProposedCertificateRequest { + const message = createBaseQueryGetProposedCertificateRequest(); message.subject = object.subject ?? ""; message.subjectKeyId = object.subjectKeyId ?? ""; - message.serialNumber = object.serialNumber ?? ""; return message; }, }; -function createBaseQueryGetProposedCertificateRevocationResponse(): QueryGetProposedCertificateRevocationResponse { - return { proposedCertificateRevocation: undefined }; +function createBaseQueryGetProposedCertificateResponse(): QueryGetProposedCertificateResponse { + return { proposedCertificate: undefined }; } -export const QueryGetProposedCertificateRevocationResponse = { - encode(message: QueryGetProposedCertificateRevocationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.proposedCertificateRevocation !== undefined) { - ProposedCertificateRevocation.encode(message.proposedCertificateRevocation, writer.uint32(10).fork()).ldelim(); +export const QueryGetProposedCertificateResponse = { + encode(message: QueryGetProposedCertificateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposedCertificate !== undefined) { + ProposedCertificate.encode(message.proposedCertificate, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetProposedCertificateRevocationResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetProposedCertificateResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetProposedCertificateRevocationResponse(); + const message = createBaseQueryGetProposedCertificateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposedCertificateRevocation = ProposedCertificateRevocation.decode(reader, reader.uint32()); + message.proposedCertificate = ProposedCertificate.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -935,51 +979,49 @@ export const QueryGetProposedCertificateRevocationResponse = { return message; }, - fromJSON(object: any): QueryGetProposedCertificateRevocationResponse { + fromJSON(object: any): QueryGetProposedCertificateResponse { return { - proposedCertificateRevocation: isSet(object.proposedCertificateRevocation) - ? ProposedCertificateRevocation.fromJSON(object.proposedCertificateRevocation) + proposedCertificate: isSet(object.proposedCertificate) + ? ProposedCertificate.fromJSON(object.proposedCertificate) : undefined, }; }, - toJSON(message: QueryGetProposedCertificateRevocationResponse): unknown { + toJSON(message: QueryGetProposedCertificateResponse): unknown { const obj: any = {}; - message.proposedCertificateRevocation !== undefined - && (obj.proposedCertificateRevocation = message.proposedCertificateRevocation - ? ProposedCertificateRevocation.toJSON(message.proposedCertificateRevocation) - : undefined); + message.proposedCertificate !== undefined && (obj.proposedCertificate = message.proposedCertificate + ? ProposedCertificate.toJSON(message.proposedCertificate) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetProposedCertificateRevocationResponse { - const message = createBaseQueryGetProposedCertificateRevocationResponse(); - message.proposedCertificateRevocation = - (object.proposedCertificateRevocation !== undefined && object.proposedCertificateRevocation !== null) - ? ProposedCertificateRevocation.fromPartial(object.proposedCertificateRevocation) - : undefined; + ): QueryGetProposedCertificateResponse { + const message = createBaseQueryGetProposedCertificateResponse(); + message.proposedCertificate = (object.proposedCertificate !== undefined && object.proposedCertificate !== null) + ? ProposedCertificate.fromPartial(object.proposedCertificate) + : undefined; return message; }, }; -function createBaseQueryAllProposedCertificateRevocationRequest(): QueryAllProposedCertificateRevocationRequest { +function createBaseQueryAllProposedCertificateRequest(): QueryAllProposedCertificateRequest { return { pagination: undefined }; } -export const QueryAllProposedCertificateRevocationRequest = { - encode(message: QueryAllProposedCertificateRevocationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryAllProposedCertificateRequest = { + encode(message: QueryAllProposedCertificateRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllProposedCertificateRevocationRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllProposedCertificateRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllProposedCertificateRevocationRequest(); + const message = createBaseQueryAllProposedCertificateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -994,21 +1036,21 @@ export const QueryAllProposedCertificateRevocationRequest = { return message; }, - fromJSON(object: any): QueryAllProposedCertificateRevocationRequest { + fromJSON(object: any): QueryAllProposedCertificateRequest { return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, - toJSON(message: QueryAllProposedCertificateRevocationRequest): unknown { + toJSON(message: QueryAllProposedCertificateRequest): unknown { const obj: any = {}; message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllProposedCertificateRevocationRequest { - const message = createBaseQueryAllProposedCertificateRevocationRequest(); + ): QueryAllProposedCertificateRequest { + const message = createBaseQueryAllProposedCertificateRequest(); message.pagination = (object.pagination !== undefined && object.pagination !== null) ? PageRequest.fromPartial(object.pagination) : undefined; @@ -1016,14 +1058,14 @@ export const QueryAllProposedCertificateRevocationRequest = { }, }; -function createBaseQueryAllProposedCertificateRevocationResponse(): QueryAllProposedCertificateRevocationResponse { - return { proposedCertificateRevocation: [], pagination: undefined }; +function createBaseQueryAllProposedCertificateResponse(): QueryAllProposedCertificateResponse { + return { proposedCertificate: [], pagination: undefined }; } -export const QueryAllProposedCertificateRevocationResponse = { - encode(message: QueryAllProposedCertificateRevocationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.proposedCertificateRevocation) { - ProposedCertificateRevocation.encode(v!, writer.uint32(10).fork()).ldelim(); +export const QueryAllProposedCertificateResponse = { + encode(message: QueryAllProposedCertificateResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.proposedCertificate) { + ProposedCertificate.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -1031,15 +1073,15 @@ export const QueryAllProposedCertificateRevocationResponse = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllProposedCertificateRevocationResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllProposedCertificateResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllProposedCertificateRevocationResponse(); + const message = createBaseQueryAllProposedCertificateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.proposedCertificateRevocation.push(ProposedCertificateRevocation.decode(reader, reader.uint32())); + message.proposedCertificate.push(ProposedCertificate.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -1052,35 +1094,32 @@ export const QueryAllProposedCertificateRevocationResponse = { return message; }, - fromJSON(object: any): QueryAllProposedCertificateRevocationResponse { + fromJSON(object: any): QueryAllProposedCertificateResponse { return { - proposedCertificateRevocation: Array.isArray(object?.proposedCertificateRevocation) - ? object.proposedCertificateRevocation.map((e: any) => ProposedCertificateRevocation.fromJSON(e)) + proposedCertificate: Array.isArray(object?.proposedCertificate) + ? object.proposedCertificate.map((e: any) => ProposedCertificate.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: QueryAllProposedCertificateRevocationResponse): unknown { + toJSON(message: QueryAllProposedCertificateResponse): unknown { const obj: any = {}; - if (message.proposedCertificateRevocation) { - obj.proposedCertificateRevocation = message.proposedCertificateRevocation.map((e) => - e ? ProposedCertificateRevocation.toJSON(e) : undefined - ); + if (message.proposedCertificate) { + obj.proposedCertificate = message.proposedCertificate.map((e) => e ? ProposedCertificate.toJSON(e) : undefined); } else { - obj.proposedCertificateRevocation = []; + obj.proposedCertificate = []; } message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllProposedCertificateRevocationResponse { - const message = createBaseQueryAllProposedCertificateRevocationResponse(); - message.proposedCertificateRevocation = - object.proposedCertificateRevocation?.map((e) => ProposedCertificateRevocation.fromPartial(e)) || []; + ): QueryAllProposedCertificateResponse { + const message = createBaseQueryAllProposedCertificateResponse(); + message.proposedCertificate = object.proposedCertificate?.map((e) => ProposedCertificate.fromPartial(e)) || []; message.pagination = (object.pagination !== undefined && object.pagination !== null) ? PageResponse.fromPartial(object.pagination) : undefined; @@ -1088,33 +1127,33 @@ export const QueryAllProposedCertificateRevocationResponse = { }, }; -function createBaseQueryGetRevokedCertificatesRequest(): QueryGetRevokedCertificatesRequest { - return { subject: "", subjectKeyId: "" }; +function createBaseQueryGetChildCertificatesRequest(): QueryGetChildCertificatesRequest { + return { issuer: "", authorityKeyId: "" }; } -export const QueryGetRevokedCertificatesRequest = { - encode(message: QueryGetRevokedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.subject !== "") { - writer.uint32(10).string(message.subject); +export const QueryGetChildCertificatesRequest = { + encode(message: QueryGetChildCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.issuer !== "") { + writer.uint32(10).string(message.issuer); } - if (message.subjectKeyId !== "") { - writer.uint32(18).string(message.subjectKeyId); + if (message.authorityKeyId !== "") { + writer.uint32(18).string(message.authorityKeyId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetChildCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetRevokedCertificatesRequest(); + const message = createBaseQueryGetChildCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.subject = reader.string(); + message.issuer = reader.string(); break; case 2: - message.subjectKeyId = reader.string(); + message.authorityKeyId = reader.string(); break; default: reader.skipType(tag & 7); @@ -1124,51 +1163,51 @@ export const QueryGetRevokedCertificatesRequest = { return message; }, - fromJSON(object: any): QueryGetRevokedCertificatesRequest { + fromJSON(object: any): QueryGetChildCertificatesRequest { return { - subject: isSet(object.subject) ? String(object.subject) : "", - subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + issuer: isSet(object.issuer) ? String(object.issuer) : "", + authorityKeyId: isSet(object.authorityKeyId) ? String(object.authorityKeyId) : "", }; }, - toJSON(message: QueryGetRevokedCertificatesRequest): unknown { + toJSON(message: QueryGetChildCertificatesRequest): unknown { const obj: any = {}; - message.subject !== undefined && (obj.subject = message.subject); - message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + message.issuer !== undefined && (obj.issuer = message.issuer); + message.authorityKeyId !== undefined && (obj.authorityKeyId = message.authorityKeyId); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetRevokedCertificatesRequest { - const message = createBaseQueryGetRevokedCertificatesRequest(); - message.subject = object.subject ?? ""; - message.subjectKeyId = object.subjectKeyId ?? ""; + ): QueryGetChildCertificatesRequest { + const message = createBaseQueryGetChildCertificatesRequest(); + message.issuer = object.issuer ?? ""; + message.authorityKeyId = object.authorityKeyId ?? ""; return message; }, }; -function createBaseQueryGetRevokedCertificatesResponse(): QueryGetRevokedCertificatesResponse { - return { revokedCertificates: undefined }; +function createBaseQueryGetChildCertificatesResponse(): QueryGetChildCertificatesResponse { + return { childCertificates: undefined }; } -export const QueryGetRevokedCertificatesResponse = { - encode(message: QueryGetRevokedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.revokedCertificates !== undefined) { - RevokedCertificates.encode(message.revokedCertificates, writer.uint32(10).fork()).ldelim(); +export const QueryGetChildCertificatesResponse = { + encode(message: QueryGetChildCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.childCertificates !== undefined) { + ChildCertificates.encode(message.childCertificates, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetChildCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetRevokedCertificatesResponse(); + const message = createBaseQueryGetChildCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.revokedCertificates = RevokedCertificates.decode(reader, reader.uint32()); + message.childCertificates = ChildCertificates.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1178,54 +1217,66 @@ export const QueryGetRevokedCertificatesResponse = { return message; }, - fromJSON(object: any): QueryGetRevokedCertificatesResponse { + fromJSON(object: any): QueryGetChildCertificatesResponse { return { - revokedCertificates: isSet(object.revokedCertificates) - ? RevokedCertificates.fromJSON(object.revokedCertificates) + childCertificates: isSet(object.childCertificates) + ? ChildCertificates.fromJSON(object.childCertificates) : undefined, }; }, - toJSON(message: QueryGetRevokedCertificatesResponse): unknown { + toJSON(message: QueryGetChildCertificatesResponse): unknown { const obj: any = {}; - message.revokedCertificates !== undefined && (obj.revokedCertificates = message.revokedCertificates - ? RevokedCertificates.toJSON(message.revokedCertificates) + message.childCertificates !== undefined && (obj.childCertificates = message.childCertificates + ? ChildCertificates.toJSON(message.childCertificates) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetRevokedCertificatesResponse { - const message = createBaseQueryGetRevokedCertificatesResponse(); - message.revokedCertificates = (object.revokedCertificates !== undefined && object.revokedCertificates !== null) - ? RevokedCertificates.fromPartial(object.revokedCertificates) + ): QueryGetChildCertificatesResponse { + const message = createBaseQueryGetChildCertificatesResponse(); + message.childCertificates = (object.childCertificates !== undefined && object.childCertificates !== null) + ? ChildCertificates.fromPartial(object.childCertificates) : undefined; return message; }, }; -function createBaseQueryAllRevokedCertificatesRequest(): QueryAllRevokedCertificatesRequest { - return { pagination: undefined }; +function createBaseQueryGetProposedCertificateRevocationRequest(): QueryGetProposedCertificateRevocationRequest { + return { subject: "", subjectKeyId: "", serialNumber: "" }; } -export const QueryAllRevokedCertificatesRequest = { - encode(message: QueryAllRevokedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); +export const QueryGetProposedCertificateRevocationRequest = { + encode(message: QueryGetProposedCertificateRevocationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); + } + if (message.serialNumber !== "") { + writer.uint32(26).string(message.serialNumber); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetProposedCertificateRevocationRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllRevokedCertificatesRequest(); + const message = createBaseQueryGetProposedCertificateRevocationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); + message.subject = reader.string(); + break; + case 2: + message.subjectKeyId = reader.string(); + break; + case 3: + message.serialNumber = reader.string(); break; default: reader.skipType(tag & 7); @@ -1235,55 +1286,54 @@ export const QueryAllRevokedCertificatesRequest = { return message; }, - fromJSON(object: any): QueryAllRevokedCertificatesRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + fromJSON(object: any): QueryGetProposedCertificateRevocationRequest { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + serialNumber: isSet(object.serialNumber) ? String(object.serialNumber) : "", + }; }, - toJSON(message: QueryAllRevokedCertificatesRequest): unknown { + toJSON(message: QueryGetProposedCertificateRevocationRequest): unknown { const obj: any = {}; - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.subject !== undefined && (obj.subject = message.subject); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + message.serialNumber !== undefined && (obj.serialNumber = message.serialNumber); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllRevokedCertificatesRequest { - const message = createBaseQueryAllRevokedCertificatesRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; + ): QueryGetProposedCertificateRevocationRequest { + const message = createBaseQueryGetProposedCertificateRevocationRequest(); + message.subject = object.subject ?? ""; + message.subjectKeyId = object.subjectKeyId ?? ""; + message.serialNumber = object.serialNumber ?? ""; return message; }, }; -function createBaseQueryAllRevokedCertificatesResponse(): QueryAllRevokedCertificatesResponse { - return { revokedCertificates: [], pagination: undefined }; +function createBaseQueryGetProposedCertificateRevocationResponse(): QueryGetProposedCertificateRevocationResponse { + return { proposedCertificateRevocation: undefined }; } -export const QueryAllRevokedCertificatesResponse = { - encode(message: QueryAllRevokedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.revokedCertificates) { - RevokedCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); +export const QueryGetProposedCertificateRevocationResponse = { + encode(message: QueryGetProposedCertificateRevocationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.proposedCertificateRevocation !== undefined) { + ProposedCertificateRevocation.encode(message.proposedCertificateRevocation, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetProposedCertificateRevocationResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllRevokedCertificatesResponse(); + const message = createBaseQueryGetProposedCertificateRevocationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.revokedCertificates.push(RevokedCertificates.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); + message.proposedCertificateRevocation = ProposedCertificateRevocation.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1293,55 +1343,57 @@ export const QueryAllRevokedCertificatesResponse = { return message; }, - fromJSON(object: any): QueryAllRevokedCertificatesResponse { + fromJSON(object: any): QueryGetProposedCertificateRevocationResponse { return { - revokedCertificates: Array.isArray(object?.revokedCertificates) - ? object.revokedCertificates.map((e: any) => RevokedCertificates.fromJSON(e)) - : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + proposedCertificateRevocation: isSet(object.proposedCertificateRevocation) + ? ProposedCertificateRevocation.fromJSON(object.proposedCertificateRevocation) + : undefined, }; }, - toJSON(message: QueryAllRevokedCertificatesResponse): unknown { + toJSON(message: QueryGetProposedCertificateRevocationResponse): unknown { const obj: any = {}; - if (message.revokedCertificates) { - obj.revokedCertificates = message.revokedCertificates.map((e) => e ? RevokedCertificates.toJSON(e) : undefined); - } else { - obj.revokedCertificates = []; - } - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.proposedCertificateRevocation !== undefined + && (obj.proposedCertificateRevocation = message.proposedCertificateRevocation + ? ProposedCertificateRevocation.toJSON(message.proposedCertificateRevocation) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllRevokedCertificatesResponse { - const message = createBaseQueryAllRevokedCertificatesResponse(); - message.revokedCertificates = object.revokedCertificates?.map((e) => RevokedCertificates.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; + ): QueryGetProposedCertificateRevocationResponse { + const message = createBaseQueryGetProposedCertificateRevocationResponse(); + message.proposedCertificateRevocation = + (object.proposedCertificateRevocation !== undefined && object.proposedCertificateRevocation !== null) + ? ProposedCertificateRevocation.fromPartial(object.proposedCertificateRevocation) + : undefined; return message; }, }; -function createBaseQueryGetApprovedRootCertificatesRequest(): QueryGetApprovedRootCertificatesRequest { - return {}; +function createBaseQueryAllProposedCertificateRevocationRequest(): QueryAllProposedCertificateRevocationRequest { + return { pagination: undefined }; } -export const QueryGetApprovedRootCertificatesRequest = { - encode(_: QueryGetApprovedRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryAllProposedCertificateRevocationRequest = { + encode(message: QueryAllProposedCertificateRevocationRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedRootCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllProposedCertificateRevocationRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetApprovedRootCertificatesRequest(); + const message = createBaseQueryAllProposedCertificateRevocationRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -1350,44 +1402,55 @@ export const QueryGetApprovedRootCertificatesRequest = { return message; }, - fromJSON(_: any): QueryGetApprovedRootCertificatesRequest { - return {}; + fromJSON(object: any): QueryAllProposedCertificateRevocationRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, - toJSON(_: QueryGetApprovedRootCertificatesRequest): unknown { + toJSON(message: QueryAllProposedCertificateRevocationRequest): unknown { const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - _: I, - ): QueryGetApprovedRootCertificatesRequest { - const message = createBaseQueryGetApprovedRootCertificatesRequest(); + fromPartial, I>>( + object: I, + ): QueryAllProposedCertificateRevocationRequest { + const message = createBaseQueryAllProposedCertificateRevocationRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseQueryGetApprovedRootCertificatesResponse(): QueryGetApprovedRootCertificatesResponse { - return { approvedRootCertificates: undefined }; +function createBaseQueryAllProposedCertificateRevocationResponse(): QueryAllProposedCertificateRevocationResponse { + return { proposedCertificateRevocation: [], pagination: undefined }; } -export const QueryGetApprovedRootCertificatesResponse = { - encode(message: QueryGetApprovedRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.approvedRootCertificates !== undefined) { - ApprovedRootCertificates.encode(message.approvedRootCertificates, writer.uint32(10).fork()).ldelim(); +export const QueryAllProposedCertificateRevocationResponse = { + encode(message: QueryAllProposedCertificateRevocationResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.proposedCertificateRevocation) { + ProposedCertificateRevocation.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedRootCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllProposedCertificateRevocationResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetApprovedRootCertificatesResponse(); + const message = createBaseQueryAllProposedCertificateRevocationResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.approvedRootCertificates = ApprovedRootCertificates.decode(reader, reader.uint32()); + message.proposedCertificateRevocation.push(ProposedCertificateRevocation.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1397,50 +1460,70 @@ export const QueryGetApprovedRootCertificatesResponse = { return message; }, - fromJSON(object: any): QueryGetApprovedRootCertificatesResponse { + fromJSON(object: any): QueryAllProposedCertificateRevocationResponse { return { - approvedRootCertificates: isSet(object.approvedRootCertificates) - ? ApprovedRootCertificates.fromJSON(object.approvedRootCertificates) - : undefined, + proposedCertificateRevocation: Array.isArray(object?.proposedCertificateRevocation) + ? object.proposedCertificateRevocation.map((e: any) => ProposedCertificateRevocation.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: QueryGetApprovedRootCertificatesResponse): unknown { + toJSON(message: QueryAllProposedCertificateRevocationResponse): unknown { const obj: any = {}; - message.approvedRootCertificates !== undefined && (obj.approvedRootCertificates = message.approvedRootCertificates - ? ApprovedRootCertificates.toJSON(message.approvedRootCertificates) - : undefined); + if (message.proposedCertificateRevocation) { + obj.proposedCertificateRevocation = message.proposedCertificateRevocation.map((e) => + e ? ProposedCertificateRevocation.toJSON(e) : undefined + ); + } else { + obj.proposedCertificateRevocation = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetApprovedRootCertificatesResponse { - const message = createBaseQueryGetApprovedRootCertificatesResponse(); - message.approvedRootCertificates = - (object.approvedRootCertificates !== undefined && object.approvedRootCertificates !== null) - ? ApprovedRootCertificates.fromPartial(object.approvedRootCertificates) - : undefined; + ): QueryAllProposedCertificateRevocationResponse { + const message = createBaseQueryAllProposedCertificateRevocationResponse(); + message.proposedCertificateRevocation = + object.proposedCertificateRevocation?.map((e) => ProposedCertificateRevocation.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseQueryGetRevokedRootCertificatesRequest(): QueryGetRevokedRootCertificatesRequest { - return {}; +function createBaseQueryGetRevokedCertificatesRequest(): QueryGetRevokedCertificatesRequest { + return { subject: "", subjectKeyId: "" }; } -export const QueryGetRevokedRootCertificatesRequest = { - encode(_: QueryGetRevokedRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryGetRevokedCertificatesRequest = { + encode(message: QueryGetRevokedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); + } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedRootCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetRevokedRootCertificatesRequest(); + const message = createBaseQueryGetRevokedCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: + message.subject = reader.string(); + break; + case 2: + message.subjectKeyId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -1449,44 +1532,51 @@ export const QueryGetRevokedRootCertificatesRequest = { return message; }, - fromJSON(_: any): QueryGetRevokedRootCertificatesRequest { - return {}; + fromJSON(object: any): QueryGetRevokedCertificatesRequest { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + }; }, - toJSON(_: QueryGetRevokedRootCertificatesRequest): unknown { + toJSON(message: QueryGetRevokedCertificatesRequest): unknown { const obj: any = {}; + message.subject !== undefined && (obj.subject = message.subject); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); return obj; }, - fromPartial, I>>( - _: I, - ): QueryGetRevokedRootCertificatesRequest { - const message = createBaseQueryGetRevokedRootCertificatesRequest(); + fromPartial, I>>( + object: I, + ): QueryGetRevokedCertificatesRequest { + const message = createBaseQueryGetRevokedCertificatesRequest(); + message.subject = object.subject ?? ""; + message.subjectKeyId = object.subjectKeyId ?? ""; return message; }, }; -function createBaseQueryGetRevokedRootCertificatesResponse(): QueryGetRevokedRootCertificatesResponse { - return { revokedRootCertificates: undefined }; +function createBaseQueryGetRevokedCertificatesResponse(): QueryGetRevokedCertificatesResponse { + return { revokedCertificates: undefined }; } -export const QueryGetRevokedRootCertificatesResponse = { - encode(message: QueryGetRevokedRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.revokedRootCertificates !== undefined) { - RevokedRootCertificates.encode(message.revokedRootCertificates, writer.uint32(10).fork()).ldelim(); +export const QueryGetRevokedCertificatesResponse = { + encode(message: QueryGetRevokedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.revokedCertificates !== undefined) { + RevokedCertificates.encode(message.revokedCertificates, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedRootCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetRevokedRootCertificatesResponse(); + const message = createBaseQueryGetRevokedCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.revokedRootCertificates = RevokedRootCertificates.decode(reader, reader.uint32()); + message.revokedCertificates = RevokedCertificates.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1496,55 +1586,54 @@ export const QueryGetRevokedRootCertificatesResponse = { return message; }, - fromJSON(object: any): QueryGetRevokedRootCertificatesResponse { + fromJSON(object: any): QueryGetRevokedCertificatesResponse { return { - revokedRootCertificates: isSet(object.revokedRootCertificates) - ? RevokedRootCertificates.fromJSON(object.revokedRootCertificates) + revokedCertificates: isSet(object.revokedCertificates) + ? RevokedCertificates.fromJSON(object.revokedCertificates) : undefined, }; }, - toJSON(message: QueryGetRevokedRootCertificatesResponse): unknown { + toJSON(message: QueryGetRevokedCertificatesResponse): unknown { const obj: any = {}; - message.revokedRootCertificates !== undefined && (obj.revokedRootCertificates = message.revokedRootCertificates - ? RevokedRootCertificates.toJSON(message.revokedRootCertificates) + message.revokedCertificates !== undefined && (obj.revokedCertificates = message.revokedCertificates + ? RevokedCertificates.toJSON(message.revokedCertificates) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetRevokedRootCertificatesResponse { - const message = createBaseQueryGetRevokedRootCertificatesResponse(); - message.revokedRootCertificates = - (object.revokedRootCertificates !== undefined && object.revokedRootCertificates !== null) - ? RevokedRootCertificates.fromPartial(object.revokedRootCertificates) - : undefined; + ): QueryGetRevokedCertificatesResponse { + const message = createBaseQueryGetRevokedCertificatesResponse(); + message.revokedCertificates = (object.revokedCertificates !== undefined && object.revokedCertificates !== null) + ? RevokedCertificates.fromPartial(object.revokedCertificates) + : undefined; return message; }, }; -function createBaseQueryGetApprovedCertificatesBySubjectRequest(): QueryGetApprovedCertificatesBySubjectRequest { - return { subject: "" }; +function createBaseQueryAllRevokedCertificatesRequest(): QueryAllRevokedCertificatesRequest { + return { pagination: undefined }; } -export const QueryGetApprovedCertificatesBySubjectRequest = { - encode(message: QueryGetApprovedCertificatesBySubjectRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.subject !== "") { - writer.uint32(10).string(message.subject); +export const QueryAllRevokedCertificatesRequest = { + encode(message: QueryAllRevokedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedCertificatesBySubjectRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetApprovedCertificatesBySubjectRequest(); + const message = createBaseQueryAllRevokedCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.subject = reader.string(); + message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1554,46 +1643,55 @@ export const QueryGetApprovedCertificatesBySubjectRequest = { return message; }, - fromJSON(object: any): QueryGetApprovedCertificatesBySubjectRequest { - return { subject: isSet(object.subject) ? String(object.subject) : "" }; + fromJSON(object: any): QueryAllRevokedCertificatesRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, - toJSON(message: QueryGetApprovedCertificatesBySubjectRequest): unknown { + toJSON(message: QueryAllRevokedCertificatesRequest): unknown { const obj: any = {}; - message.subject !== undefined && (obj.subject = message.subject); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetApprovedCertificatesBySubjectRequest { - const message = createBaseQueryGetApprovedCertificatesBySubjectRequest(); - message.subject = object.subject ?? ""; + ): QueryAllRevokedCertificatesRequest { + const message = createBaseQueryAllRevokedCertificatesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseQueryGetApprovedCertificatesBySubjectResponse(): QueryGetApprovedCertificatesBySubjectResponse { - return { approvedCertificatesBySubject: undefined }; +function createBaseQueryAllRevokedCertificatesResponse(): QueryAllRevokedCertificatesResponse { + return { revokedCertificates: [], pagination: undefined }; } -export const QueryGetApprovedCertificatesBySubjectResponse = { - encode(message: QueryGetApprovedCertificatesBySubjectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.approvedCertificatesBySubject !== undefined) { - ApprovedCertificatesBySubject.encode(message.approvedCertificatesBySubject, writer.uint32(10).fork()).ldelim(); - } +export const QueryAllRevokedCertificatesResponse = { + encode(message: QueryAllRevokedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.revokedCertificates) { + RevokedCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedCertificatesBySubjectResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetApprovedCertificatesBySubjectResponse(); + const message = createBaseQueryAllRevokedCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.approvedCertificatesBySubject = ApprovedCertificatesBySubject.decode(reader, reader.uint32()); + message.revokedCertificates.push(RevokedCertificates.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1603,63 +1701,55 @@ export const QueryGetApprovedCertificatesBySubjectResponse = { return message; }, - fromJSON(object: any): QueryGetApprovedCertificatesBySubjectResponse { + fromJSON(object: any): QueryAllRevokedCertificatesResponse { return { - approvedCertificatesBySubject: isSet(object.approvedCertificatesBySubject) - ? ApprovedCertificatesBySubject.fromJSON(object.approvedCertificatesBySubject) - : undefined, + revokedCertificates: Array.isArray(object?.revokedCertificates) + ? object.revokedCertificates.map((e: any) => RevokedCertificates.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: QueryGetApprovedCertificatesBySubjectResponse): unknown { + toJSON(message: QueryAllRevokedCertificatesResponse): unknown { const obj: any = {}; - message.approvedCertificatesBySubject !== undefined - && (obj.approvedCertificatesBySubject = message.approvedCertificatesBySubject - ? ApprovedCertificatesBySubject.toJSON(message.approvedCertificatesBySubject) - : undefined); + if (message.revokedCertificates) { + obj.revokedCertificates = message.revokedCertificates.map((e) => e ? RevokedCertificates.toJSON(e) : undefined); + } else { + obj.revokedCertificates = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetApprovedCertificatesBySubjectResponse { - const message = createBaseQueryGetApprovedCertificatesBySubjectResponse(); - message.approvedCertificatesBySubject = - (object.approvedCertificatesBySubject !== undefined && object.approvedCertificatesBySubject !== null) - ? ApprovedCertificatesBySubject.fromPartial(object.approvedCertificatesBySubject) - : undefined; + ): QueryAllRevokedCertificatesResponse { + const message = createBaseQueryAllRevokedCertificatesResponse(); + message.revokedCertificates = object.revokedCertificates?.map((e) => RevokedCertificates.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseQueryGetRejectedCertificatesRequest(): QueryGetRejectedCertificatesRequest { - return { subject: "", subjectKeyId: "" }; +function createBaseQueryGetApprovedRootCertificatesRequest(): QueryGetApprovedRootCertificatesRequest { + return {}; } -export const QueryGetRejectedCertificatesRequest = { - encode(message: QueryGetRejectedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.subject !== "") { - writer.uint32(10).string(message.subject); - } - if (message.subjectKeyId !== "") { - writer.uint32(18).string(message.subjectKeyId); - } +export const QueryGetApprovedRootCertificatesRequest = { + encode(_: QueryGetApprovedRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRejectedCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedRootCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetRejectedCertificatesRequest(); + const message = createBaseQueryGetApprovedRootCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.subject = reader.string(); - break; - case 2: - message.subjectKeyId = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -1668,51 +1758,44 @@ export const QueryGetRejectedCertificatesRequest = { return message; }, - fromJSON(object: any): QueryGetRejectedCertificatesRequest { - return { - subject: isSet(object.subject) ? String(object.subject) : "", - subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", - }; + fromJSON(_: any): QueryGetApprovedRootCertificatesRequest { + return {}; }, - toJSON(message: QueryGetRejectedCertificatesRequest): unknown { + toJSON(_: QueryGetApprovedRootCertificatesRequest): unknown { const obj: any = {}; - message.subject !== undefined && (obj.subject = message.subject); - message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGetRejectedCertificatesRequest { - const message = createBaseQueryGetRejectedCertificatesRequest(); - message.subject = object.subject ?? ""; - message.subjectKeyId = object.subjectKeyId ?? ""; + fromPartial, I>>( + _: I, + ): QueryGetApprovedRootCertificatesRequest { + const message = createBaseQueryGetApprovedRootCertificatesRequest(); return message; }, }; -function createBaseQueryGetRejectedCertificatesResponse(): QueryGetRejectedCertificatesResponse { - return { rejectedCertificate: undefined }; +function createBaseQueryGetApprovedRootCertificatesResponse(): QueryGetApprovedRootCertificatesResponse { + return { approvedRootCertificates: undefined }; } -export const QueryGetRejectedCertificatesResponse = { - encode(message: QueryGetRejectedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.rejectedCertificate !== undefined) { - RejectedCertificate.encode(message.rejectedCertificate, writer.uint32(10).fork()).ldelim(); +export const QueryGetApprovedRootCertificatesResponse = { + encode(message: QueryGetApprovedRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.approvedRootCertificates !== undefined) { + ApprovedRootCertificates.encode(message.approvedRootCertificates, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRejectedCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedRootCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetRejectedCertificatesResponse(); + const message = createBaseQueryGetApprovedRootCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.rejectedCertificate = RejectedCertificate.decode(reader, reader.uint32()); + message.approvedRootCertificates = ApprovedRootCertificates.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1722,55 +1805,50 @@ export const QueryGetRejectedCertificatesResponse = { return message; }, - fromJSON(object: any): QueryGetRejectedCertificatesResponse { + fromJSON(object: any): QueryGetApprovedRootCertificatesResponse { return { - rejectedCertificate: isSet(object.rejectedCertificate) - ? RejectedCertificate.fromJSON(object.rejectedCertificate) + approvedRootCertificates: isSet(object.approvedRootCertificates) + ? ApprovedRootCertificates.fromJSON(object.approvedRootCertificates) : undefined, }; }, - toJSON(message: QueryGetRejectedCertificatesResponse): unknown { + toJSON(message: QueryGetApprovedRootCertificatesResponse): unknown { const obj: any = {}; - message.rejectedCertificate !== undefined && (obj.rejectedCertificate = message.rejectedCertificate - ? RejectedCertificate.toJSON(message.rejectedCertificate) + message.approvedRootCertificates !== undefined && (obj.approvedRootCertificates = message.approvedRootCertificates + ? ApprovedRootCertificates.toJSON(message.approvedRootCertificates) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetRejectedCertificatesResponse { - const message = createBaseQueryGetRejectedCertificatesResponse(); - message.rejectedCertificate = (object.rejectedCertificate !== undefined && object.rejectedCertificate !== null) - ? RejectedCertificate.fromPartial(object.rejectedCertificate) - : undefined; + ): QueryGetApprovedRootCertificatesResponse { + const message = createBaseQueryGetApprovedRootCertificatesResponse(); + message.approvedRootCertificates = + (object.approvedRootCertificates !== undefined && object.approvedRootCertificates !== null) + ? ApprovedRootCertificates.fromPartial(object.approvedRootCertificates) + : undefined; return message; }, }; -function createBaseQueryAllRejectedCertificatesRequest(): QueryAllRejectedCertificatesRequest { - return { pagination: undefined }; +function createBaseQueryGetRevokedRootCertificatesRequest(): QueryGetRevokedRootCertificatesRequest { + return {}; } -export const QueryAllRejectedCertificatesRequest = { - encode(message: QueryAllRejectedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); - } +export const QueryGetRevokedRootCertificatesRequest = { + encode(_: QueryGetRevokedRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRejectedCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedRootCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllRejectedCertificatesRequest(); + const message = createBaseQueryGetRevokedRootCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -1779,55 +1857,44 @@ export const QueryAllRejectedCertificatesRequest = { return message; }, - fromJSON(object: any): QueryAllRejectedCertificatesRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + fromJSON(_: any): QueryGetRevokedRootCertificatesRequest { + return {}; }, - toJSON(message: QueryAllRejectedCertificatesRequest): unknown { + toJSON(_: QueryGetRevokedRootCertificatesRequest): unknown { const obj: any = {}; - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryAllRejectedCertificatesRequest { - const message = createBaseQueryAllRejectedCertificatesRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; + fromPartial, I>>( + _: I, + ): QueryGetRevokedRootCertificatesRequest { + const message = createBaseQueryGetRevokedRootCertificatesRequest(); return message; }, }; -function createBaseQueryAllRejectedCertificatesResponse(): QueryAllRejectedCertificatesResponse { - return { rejectedCertificate: [], pagination: undefined }; +function createBaseQueryGetRevokedRootCertificatesResponse(): QueryGetRevokedRootCertificatesResponse { + return { revokedRootCertificates: undefined }; } -export const QueryAllRejectedCertificatesResponse = { - encode(message: QueryAllRejectedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.rejectedCertificate) { - RejectedCertificate.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); +export const QueryGetRevokedRootCertificatesResponse = { + encode(message: QueryGetRevokedRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.revokedRootCertificates !== undefined) { + RevokedRootCertificates.encode(message.revokedRootCertificates, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRejectedCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedRootCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllRejectedCertificatesResponse(); + const message = createBaseQueryGetRevokedRootCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.rejectedCertificate.push(RejectedCertificate.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); + message.revokedRootCertificates = RevokedRootCertificates.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1837,72 +1904,55 @@ export const QueryAllRejectedCertificatesResponse = { return message; }, - fromJSON(object: any): QueryAllRejectedCertificatesResponse { + fromJSON(object: any): QueryGetRevokedRootCertificatesResponse { return { - rejectedCertificate: Array.isArray(object?.rejectedCertificate) - ? object.rejectedCertificate.map((e: any) => RejectedCertificate.fromJSON(e)) - : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + revokedRootCertificates: isSet(object.revokedRootCertificates) + ? RevokedRootCertificates.fromJSON(object.revokedRootCertificates) + : undefined, }; }, - toJSON(message: QueryAllRejectedCertificatesResponse): unknown { + toJSON(message: QueryGetRevokedRootCertificatesResponse): unknown { const obj: any = {}; - if (message.rejectedCertificate) { - obj.rejectedCertificate = message.rejectedCertificate.map((e) => e ? RejectedCertificate.toJSON(e) : undefined); - } else { - obj.rejectedCertificate = []; - } - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.revokedRootCertificates !== undefined && (obj.revokedRootCertificates = message.revokedRootCertificates + ? RevokedRootCertificates.toJSON(message.revokedRootCertificates) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllRejectedCertificatesResponse { - const message = createBaseQueryAllRejectedCertificatesResponse(); - message.rejectedCertificate = object.rejectedCertificate?.map((e) => RejectedCertificate.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; + ): QueryGetRevokedRootCertificatesResponse { + const message = createBaseQueryGetRevokedRootCertificatesResponse(); + message.revokedRootCertificates = + (object.revokedRootCertificates !== undefined && object.revokedRootCertificates !== null) + ? RevokedRootCertificates.fromPartial(object.revokedRootCertificates) + : undefined; return message; }, }; -function createBaseQueryGetPkiRevocationDistributionPointRequest(): QueryGetPkiRevocationDistributionPointRequest { - return { vid: 0, label: "", issuerSubjectKeyID: "" }; +function createBaseQueryGetApprovedCertificatesBySubjectRequest(): QueryGetApprovedCertificatesBySubjectRequest { + return { subject: "" }; } -export const QueryGetPkiRevocationDistributionPointRequest = { - encode(message: QueryGetPkiRevocationDistributionPointRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.vid !== 0) { - writer.uint32(8).int32(message.vid); - } - if (message.label !== "") { - writer.uint32(18).string(message.label); - } - if (message.issuerSubjectKeyID !== "") { - writer.uint32(26).string(message.issuerSubjectKeyID); +export const QueryGetApprovedCertificatesBySubjectRequest = { + encode(message: QueryGetApprovedCertificatesBySubjectRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetPkiRevocationDistributionPointRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedCertificatesBySubjectRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetPkiRevocationDistributionPointRequest(); + const message = createBaseQueryGetApprovedCertificatesBySubjectRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.vid = reader.int32(); - break; - case 2: - message.label = reader.string(); - break; - case 3: - message.issuerSubjectKeyID = reader.string(); + message.subject = reader.string(); break; default: reader.skipType(tag & 7); @@ -1912,57 +1962,46 @@ export const QueryGetPkiRevocationDistributionPointRequest = { return message; }, - fromJSON(object: any): QueryGetPkiRevocationDistributionPointRequest { - return { - vid: isSet(object.vid) ? Number(object.vid) : 0, - label: isSet(object.label) ? String(object.label) : "", - issuerSubjectKeyID: isSet(object.issuerSubjectKeyID) ? String(object.issuerSubjectKeyID) : "", - }; + fromJSON(object: any): QueryGetApprovedCertificatesBySubjectRequest { + return { subject: isSet(object.subject) ? String(object.subject) : "" }; }, - toJSON(message: QueryGetPkiRevocationDistributionPointRequest): unknown { + toJSON(message: QueryGetApprovedCertificatesBySubjectRequest): unknown { const obj: any = {}; - message.vid !== undefined && (obj.vid = Math.round(message.vid)); - message.label !== undefined && (obj.label = message.label); - message.issuerSubjectKeyID !== undefined && (obj.issuerSubjectKeyID = message.issuerSubjectKeyID); + message.subject !== undefined && (obj.subject = message.subject); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetPkiRevocationDistributionPointRequest { - const message = createBaseQueryGetPkiRevocationDistributionPointRequest(); - message.vid = object.vid ?? 0; - message.label = object.label ?? ""; - message.issuerSubjectKeyID = object.issuerSubjectKeyID ?? ""; + ): QueryGetApprovedCertificatesBySubjectRequest { + const message = createBaseQueryGetApprovedCertificatesBySubjectRequest(); + message.subject = object.subject ?? ""; return message; }, }; -function createBaseQueryGetPkiRevocationDistributionPointResponse(): QueryGetPkiRevocationDistributionPointResponse { - return { PkiRevocationDistributionPoint: undefined }; +function createBaseQueryGetApprovedCertificatesBySubjectResponse(): QueryGetApprovedCertificatesBySubjectResponse { + return { approvedCertificatesBySubject: undefined }; } -export const QueryGetPkiRevocationDistributionPointResponse = { - encode( - message: QueryGetPkiRevocationDistributionPointResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (message.PkiRevocationDistributionPoint !== undefined) { - PkiRevocationDistributionPoint.encode(message.PkiRevocationDistributionPoint, writer.uint32(10).fork()).ldelim(); +export const QueryGetApprovedCertificatesBySubjectResponse = { + encode(message: QueryGetApprovedCertificatesBySubjectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.approvedCertificatesBySubject !== undefined) { + ApprovedCertificatesBySubject.encode(message.approvedCertificatesBySubject, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetPkiRevocationDistributionPointResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetApprovedCertificatesBySubjectResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetPkiRevocationDistributionPointResponse(); + const message = createBaseQueryGetApprovedCertificatesBySubjectResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.PkiRevocationDistributionPoint = PkiRevocationDistributionPoint.decode(reader, reader.uint32()); + message.approvedCertificatesBySubject = ApprovedCertificatesBySubject.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -1972,56 +2011,62 @@ export const QueryGetPkiRevocationDistributionPointResponse = { return message; }, - fromJSON(object: any): QueryGetPkiRevocationDistributionPointResponse { + fromJSON(object: any): QueryGetApprovedCertificatesBySubjectResponse { return { - PkiRevocationDistributionPoint: isSet(object.PkiRevocationDistributionPoint) - ? PkiRevocationDistributionPoint.fromJSON(object.PkiRevocationDistributionPoint) + approvedCertificatesBySubject: isSet(object.approvedCertificatesBySubject) + ? ApprovedCertificatesBySubject.fromJSON(object.approvedCertificatesBySubject) : undefined, }; }, - toJSON(message: QueryGetPkiRevocationDistributionPointResponse): unknown { + toJSON(message: QueryGetApprovedCertificatesBySubjectResponse): unknown { const obj: any = {}; - message.PkiRevocationDistributionPoint !== undefined - && (obj.PkiRevocationDistributionPoint = message.PkiRevocationDistributionPoint - ? PkiRevocationDistributionPoint.toJSON(message.PkiRevocationDistributionPoint) + message.approvedCertificatesBySubject !== undefined + && (obj.approvedCertificatesBySubject = message.approvedCertificatesBySubject + ? ApprovedCertificatesBySubject.toJSON(message.approvedCertificatesBySubject) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetPkiRevocationDistributionPointResponse { - const message = createBaseQueryGetPkiRevocationDistributionPointResponse(); - message.PkiRevocationDistributionPoint = - (object.PkiRevocationDistributionPoint !== undefined && object.PkiRevocationDistributionPoint !== null) - ? PkiRevocationDistributionPoint.fromPartial(object.PkiRevocationDistributionPoint) + ): QueryGetApprovedCertificatesBySubjectResponse { + const message = createBaseQueryGetApprovedCertificatesBySubjectResponse(); + message.approvedCertificatesBySubject = + (object.approvedCertificatesBySubject !== undefined && object.approvedCertificatesBySubject !== null) + ? ApprovedCertificatesBySubject.fromPartial(object.approvedCertificatesBySubject) : undefined; return message; }, }; -function createBaseQueryAllPkiRevocationDistributionPointRequest(): QueryAllPkiRevocationDistributionPointRequest { - return { pagination: undefined }; +function createBaseQueryGetRejectedCertificatesRequest(): QueryGetRejectedCertificatesRequest { + return { subject: "", subjectKeyId: "" }; } -export const QueryAllPkiRevocationDistributionPointRequest = { - encode(message: QueryAllPkiRevocationDistributionPointRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); +export const QueryGetRejectedCertificatesRequest = { + encode(message: QueryGetRejectedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllPkiRevocationDistributionPointRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRejectedCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllPkiRevocationDistributionPointRequest(); + const message = createBaseQueryGetRejectedCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); + message.subject = reader.string(); + break; + case 2: + message.subjectKeyId = reader.string(); break; default: reader.skipType(tag & 7); @@ -2031,58 +2076,51 @@ export const QueryAllPkiRevocationDistributionPointRequest = { return message; }, - fromJSON(object: any): QueryAllPkiRevocationDistributionPointRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + fromJSON(object: any): QueryGetRejectedCertificatesRequest { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + }; }, - toJSON(message: QueryAllPkiRevocationDistributionPointRequest): unknown { + toJSON(message: QueryGetRejectedCertificatesRequest): unknown { const obj: any = {}; - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.subject !== undefined && (obj.subject = message.subject); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllPkiRevocationDistributionPointRequest { - const message = createBaseQueryAllPkiRevocationDistributionPointRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; + ): QueryGetRejectedCertificatesRequest { + const message = createBaseQueryGetRejectedCertificatesRequest(); + message.subject = object.subject ?? ""; + message.subjectKeyId = object.subjectKeyId ?? ""; return message; }, }; -function createBaseQueryAllPkiRevocationDistributionPointResponse(): QueryAllPkiRevocationDistributionPointResponse { - return { PkiRevocationDistributionPoint: [], pagination: undefined }; +function createBaseQueryGetRejectedCertificatesResponse(): QueryGetRejectedCertificatesResponse { + return { rejectedCertificate: undefined }; } -export const QueryAllPkiRevocationDistributionPointResponse = { - encode( - message: QueryAllPkiRevocationDistributionPointResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - for (const v of message.PkiRevocationDistributionPoint) { - PkiRevocationDistributionPoint.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); +export const QueryGetRejectedCertificatesResponse = { + encode(message: QueryGetRejectedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.rejectedCertificate !== undefined) { + RejectedCertificate.encode(message.rejectedCertificate, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllPkiRevocationDistributionPointResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRejectedCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllPkiRevocationDistributionPointResponse(); + const message = createBaseQueryGetRejectedCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.PkiRevocationDistributionPoint.push(PkiRevocationDistributionPoint.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); + message.rejectedCertificate = RejectedCertificate.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2092,69 +2130,54 @@ export const QueryAllPkiRevocationDistributionPointResponse = { return message; }, - fromJSON(object: any): QueryAllPkiRevocationDistributionPointResponse { + fromJSON(object: any): QueryGetRejectedCertificatesResponse { return { - PkiRevocationDistributionPoint: Array.isArray(object?.PkiRevocationDistributionPoint) - ? object.PkiRevocationDistributionPoint.map((e: any) => PkiRevocationDistributionPoint.fromJSON(e)) - : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + rejectedCertificate: isSet(object.rejectedCertificate) + ? RejectedCertificate.fromJSON(object.rejectedCertificate) + : undefined, }; }, - toJSON(message: QueryAllPkiRevocationDistributionPointResponse): unknown { + toJSON(message: QueryGetRejectedCertificatesResponse): unknown { const obj: any = {}; - if (message.PkiRevocationDistributionPoint) { - obj.PkiRevocationDistributionPoint = message.PkiRevocationDistributionPoint.map((e) => - e ? PkiRevocationDistributionPoint.toJSON(e) : undefined - ); - } else { - obj.PkiRevocationDistributionPoint = []; - } - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.rejectedCertificate !== undefined && (obj.rejectedCertificate = message.rejectedCertificate + ? RejectedCertificate.toJSON(message.rejectedCertificate) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllPkiRevocationDistributionPointResponse { - const message = createBaseQueryAllPkiRevocationDistributionPointResponse(); - message.PkiRevocationDistributionPoint = - object.PkiRevocationDistributionPoint?.map((e) => PkiRevocationDistributionPoint.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) + ): QueryGetRejectedCertificatesResponse { + const message = createBaseQueryGetRejectedCertificatesResponse(); + message.rejectedCertificate = (object.rejectedCertificate !== undefined && object.rejectedCertificate !== null) + ? RejectedCertificate.fromPartial(object.rejectedCertificate) : undefined; return message; }, }; -function createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest(): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest { - return { issuerSubjectKeyID: "" }; +function createBaseQueryAllRejectedCertificatesRequest(): QueryAllRejectedCertificatesRequest { + return { pagination: undefined }; } -export const QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest = { - encode( - message: QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (message.issuerSubjectKeyID !== "") { - writer.uint32(10).string(message.issuerSubjectKeyID); +export const QueryAllRejectedCertificatesRequest = { + encode(message: QueryAllRejectedCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number, - ): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRejectedCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest(); + const message = createBaseQueryAllRejectedCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.issuerSubjectKeyID = reader.string(); + message.pagination = PageRequest.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2164,56 +2187,55 @@ export const QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest return message; }, - fromJSON(object: any): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest { - return { issuerSubjectKeyID: isSet(object.issuerSubjectKeyID) ? String(object.issuerSubjectKeyID) : "" }; + fromJSON(object: any): QueryAllRejectedCertificatesRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, - toJSON(message: QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest): unknown { + toJSON(message: QueryAllRejectedCertificatesRequest): unknown { const obj: any = {}; - message.issuerSubjectKeyID !== undefined && (obj.issuerSubjectKeyID = message.issuerSubjectKeyID); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest { - const message = createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest(); - message.issuerSubjectKeyID = object.issuerSubjectKeyID ?? ""; + ): QueryAllRejectedCertificatesRequest { + const message = createBaseQueryAllRejectedCertificatesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse(): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse { - return { pkiRevocationDistributionPointsByIssuerSubjectKeyID: undefined }; +function createBaseQueryAllRejectedCertificatesResponse(): QueryAllRejectedCertificatesResponse { + return { rejectedCertificate: [], pagination: undefined }; } -export const QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse = { - encode( - message: QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (message.pkiRevocationDistributionPointsByIssuerSubjectKeyID !== undefined) { - PkiRevocationDistributionPointsByIssuerSubjectKeyID.encode( - message.pkiRevocationDistributionPointsByIssuerSubjectKeyID, - writer.uint32(10).fork(), - ).ldelim(); +export const QueryAllRejectedCertificatesResponse = { + encode(message: QueryAllRejectedCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.rejectedCertificate) { + RejectedCertificate.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode( - input: _m0.Reader | Uint8Array, - length?: number, - ): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRejectedCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse(); + const message = createBaseQueryAllRejectedCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pkiRevocationDistributionPointsByIssuerSubjectKeyID = - PkiRevocationDistributionPointsByIssuerSubjectKeyID.decode(reader, reader.uint32()); + message.rejectedCertificate.push(RejectedCertificate.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2223,66 +2245,73 @@ export const QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse return message; }, - fromJSON(object: any): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse { + fromJSON(object: any): QueryAllRejectedCertificatesResponse { return { - pkiRevocationDistributionPointsByIssuerSubjectKeyID: - isSet(object.pkiRevocationDistributionPointsByIssuerSubjectKeyID) - ? PkiRevocationDistributionPointsByIssuerSubjectKeyID.fromJSON( - object.pkiRevocationDistributionPointsByIssuerSubjectKeyID, - ) - : undefined, + rejectedCertificate: Array.isArray(object?.rejectedCertificate) + ? object.rejectedCertificate.map((e: any) => RejectedCertificate.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse): unknown { + toJSON(message: QueryAllRejectedCertificatesResponse): unknown { const obj: any = {}; - message.pkiRevocationDistributionPointsByIssuerSubjectKeyID !== undefined - && (obj.pkiRevocationDistributionPointsByIssuerSubjectKeyID = - message.pkiRevocationDistributionPointsByIssuerSubjectKeyID - ? PkiRevocationDistributionPointsByIssuerSubjectKeyID.toJSON( - message.pkiRevocationDistributionPointsByIssuerSubjectKeyID, - ) - : undefined); + if (message.rejectedCertificate) { + obj.rejectedCertificate = message.rejectedCertificate.map((e) => e ? RejectedCertificate.toJSON(e) : undefined); + } else { + obj.rejectedCertificate = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse { - const message = createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse(); - message.pkiRevocationDistributionPointsByIssuerSubjectKeyID = - (object.pkiRevocationDistributionPointsByIssuerSubjectKeyID !== undefined - && object.pkiRevocationDistributionPointsByIssuerSubjectKeyID !== null) - ? PkiRevocationDistributionPointsByIssuerSubjectKeyID.fromPartial( - object.pkiRevocationDistributionPointsByIssuerSubjectKeyID, - ) - : undefined; + ): QueryAllRejectedCertificatesResponse { + const message = createBaseQueryAllRejectedCertificatesResponse(); + message.rejectedCertificate = object.rejectedCertificate?.map((e) => RejectedCertificate.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseQueryGetNocRootCertificatesRequest(): QueryGetNocRootCertificatesRequest { - return { vid: 0 }; +function createBaseQueryGetPkiRevocationDistributionPointRequest(): QueryGetPkiRevocationDistributionPointRequest { + return { vid: 0, label: "", issuerSubjectKeyID: "" }; } -export const QueryGetNocRootCertificatesRequest = { - encode(message: QueryGetNocRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryGetPkiRevocationDistributionPointRequest = { + encode(message: QueryGetPkiRevocationDistributionPointRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.vid !== 0) { writer.uint32(8).int32(message.vid); } + if (message.label !== "") { + writer.uint32(18).string(message.label); + } + if (message.issuerSubjectKeyID !== "") { + writer.uint32(26).string(message.issuerSubjectKeyID); + } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocRootCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetPkiRevocationDistributionPointRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetNocRootCertificatesRequest(); + const message = createBaseQueryGetPkiRevocationDistributionPointRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.vid = reader.int32(); break; + case 2: + message.label = reader.string(); + break; + case 3: + message.issuerSubjectKeyID = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -2291,46 +2320,57 @@ export const QueryGetNocRootCertificatesRequest = { return message; }, - fromJSON(object: any): QueryGetNocRootCertificatesRequest { - return { vid: isSet(object.vid) ? Number(object.vid) : 0 }; + fromJSON(object: any): QueryGetPkiRevocationDistributionPointRequest { + return { + vid: isSet(object.vid) ? Number(object.vid) : 0, + label: isSet(object.label) ? String(object.label) : "", + issuerSubjectKeyID: isSet(object.issuerSubjectKeyID) ? String(object.issuerSubjectKeyID) : "", + }; }, - toJSON(message: QueryGetNocRootCertificatesRequest): unknown { + toJSON(message: QueryGetPkiRevocationDistributionPointRequest): unknown { const obj: any = {}; message.vid !== undefined && (obj.vid = Math.round(message.vid)); + message.label !== undefined && (obj.label = message.label); + message.issuerSubjectKeyID !== undefined && (obj.issuerSubjectKeyID = message.issuerSubjectKeyID); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetNocRootCertificatesRequest { - const message = createBaseQueryGetNocRootCertificatesRequest(); + ): QueryGetPkiRevocationDistributionPointRequest { + const message = createBaseQueryGetPkiRevocationDistributionPointRequest(); message.vid = object.vid ?? 0; + message.label = object.label ?? ""; + message.issuerSubjectKeyID = object.issuerSubjectKeyID ?? ""; return message; }, }; -function createBaseQueryGetNocRootCertificatesResponse(): QueryGetNocRootCertificatesResponse { - return { nocRootCertificates: undefined }; +function createBaseQueryGetPkiRevocationDistributionPointResponse(): QueryGetPkiRevocationDistributionPointResponse { + return { PkiRevocationDistributionPoint: undefined }; } -export const QueryGetNocRootCertificatesResponse = { - encode(message: QueryGetNocRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.nocRootCertificates !== undefined) { - NocRootCertificates.encode(message.nocRootCertificates, writer.uint32(10).fork()).ldelim(); +export const QueryGetPkiRevocationDistributionPointResponse = { + encode( + message: QueryGetPkiRevocationDistributionPointResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.PkiRevocationDistributionPoint !== undefined) { + PkiRevocationDistributionPoint.encode(message.PkiRevocationDistributionPoint, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocRootCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetPkiRevocationDistributionPointResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetNocRootCertificatesResponse(); + const message = createBaseQueryGetPkiRevocationDistributionPointResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.nocRootCertificates = NocRootCertificates.decode(reader, reader.uint32()); + message.PkiRevocationDistributionPoint = PkiRevocationDistributionPoint.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2340,49 +2380,884 @@ export const QueryGetNocRootCertificatesResponse = { return message; }, - fromJSON(object: any): QueryGetNocRootCertificatesResponse { + fromJSON(object: any): QueryGetPkiRevocationDistributionPointResponse { return { - nocRootCertificates: isSet(object.nocRootCertificates) - ? NocRootCertificates.fromJSON(object.nocRootCertificates) + PkiRevocationDistributionPoint: isSet(object.PkiRevocationDistributionPoint) + ? PkiRevocationDistributionPoint.fromJSON(object.PkiRevocationDistributionPoint) : undefined, }; }, - toJSON(message: QueryGetNocRootCertificatesResponse): unknown { + toJSON(message: QueryGetPkiRevocationDistributionPointResponse): unknown { const obj: any = {}; - message.nocRootCertificates !== undefined && (obj.nocRootCertificates = message.nocRootCertificates - ? NocRootCertificates.toJSON(message.nocRootCertificates) - : undefined); + message.PkiRevocationDistributionPoint !== undefined + && (obj.PkiRevocationDistributionPoint = message.PkiRevocationDistributionPoint + ? PkiRevocationDistributionPoint.toJSON(message.PkiRevocationDistributionPoint) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetPkiRevocationDistributionPointResponse { + const message = createBaseQueryGetPkiRevocationDistributionPointResponse(); + message.PkiRevocationDistributionPoint = + (object.PkiRevocationDistributionPoint !== undefined && object.PkiRevocationDistributionPoint !== null) + ? PkiRevocationDistributionPoint.fromPartial(object.PkiRevocationDistributionPoint) + : undefined; + return message; + }, +}; + +function createBaseQueryAllPkiRevocationDistributionPointRequest(): QueryAllPkiRevocationDistributionPointRequest { + return { pagination: undefined }; +} + +export const QueryAllPkiRevocationDistributionPointRequest = { + encode(message: QueryAllPkiRevocationDistributionPointRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllPkiRevocationDistributionPointRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPkiRevocationDistributionPointRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllPkiRevocationDistributionPointRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryAllPkiRevocationDistributionPointRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllPkiRevocationDistributionPointRequest { + const message = createBaseQueryAllPkiRevocationDistributionPointRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryAllPkiRevocationDistributionPointResponse(): QueryAllPkiRevocationDistributionPointResponse { + return { PkiRevocationDistributionPoint: [], pagination: undefined }; +} + +export const QueryAllPkiRevocationDistributionPointResponse = { + encode( + message: QueryAllPkiRevocationDistributionPointResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + for (const v of message.PkiRevocationDistributionPoint) { + PkiRevocationDistributionPoint.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllPkiRevocationDistributionPointResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllPkiRevocationDistributionPointResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.PkiRevocationDistributionPoint.push(PkiRevocationDistributionPoint.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllPkiRevocationDistributionPointResponse { + return { + PkiRevocationDistributionPoint: Array.isArray(object?.PkiRevocationDistributionPoint) + ? object.PkiRevocationDistributionPoint.map((e: any) => PkiRevocationDistributionPoint.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryAllPkiRevocationDistributionPointResponse): unknown { + const obj: any = {}; + if (message.PkiRevocationDistributionPoint) { + obj.PkiRevocationDistributionPoint = message.PkiRevocationDistributionPoint.map((e) => + e ? PkiRevocationDistributionPoint.toJSON(e) : undefined + ); + } else { + obj.PkiRevocationDistributionPoint = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllPkiRevocationDistributionPointResponse { + const message = createBaseQueryAllPkiRevocationDistributionPointResponse(); + message.PkiRevocationDistributionPoint = + object.PkiRevocationDistributionPoint?.map((e) => PkiRevocationDistributionPoint.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest(): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest { + return { issuerSubjectKeyID: "" }; +} + +export const QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest = { + encode( + message: QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.issuerSubjectKeyID !== "") { + writer.uint32(10).string(message.issuerSubjectKeyID); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.issuerSubjectKeyID = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest { + return { issuerSubjectKeyID: isSet(object.issuerSubjectKeyID) ? String(object.issuerSubjectKeyID) : "" }; + }, + + toJSON(message: QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest): unknown { + const obj: any = {}; + message.issuerSubjectKeyID !== undefined && (obj.issuerSubjectKeyID = message.issuerSubjectKeyID); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest { + const message = createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest(); + message.issuerSubjectKeyID = object.issuerSubjectKeyID ?? ""; + return message; + }, +}; + +function createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse(): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse { + return { pkiRevocationDistributionPointsByIssuerSubjectKeyID: undefined }; +} + +export const QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse = { + encode( + message: QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse, + writer: _m0.Writer = _m0.Writer.create(), + ): _m0.Writer { + if (message.pkiRevocationDistributionPointsByIssuerSubjectKeyID !== undefined) { + PkiRevocationDistributionPointsByIssuerSubjectKeyID.encode( + message.pkiRevocationDistributionPointsByIssuerSubjectKeyID, + writer.uint32(10).fork(), + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number, + ): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pkiRevocationDistributionPointsByIssuerSubjectKeyID = + PkiRevocationDistributionPointsByIssuerSubjectKeyID.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse { + return { + pkiRevocationDistributionPointsByIssuerSubjectKeyID: + isSet(object.pkiRevocationDistributionPointsByIssuerSubjectKeyID) + ? PkiRevocationDistributionPointsByIssuerSubjectKeyID.fromJSON( + object.pkiRevocationDistributionPointsByIssuerSubjectKeyID, + ) + : undefined, + }; + }, + + toJSON(message: QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse): unknown { + const obj: any = {}; + message.pkiRevocationDistributionPointsByIssuerSubjectKeyID !== undefined + && (obj.pkiRevocationDistributionPointsByIssuerSubjectKeyID = + message.pkiRevocationDistributionPointsByIssuerSubjectKeyID + ? PkiRevocationDistributionPointsByIssuerSubjectKeyID.toJSON( + message.pkiRevocationDistributionPointsByIssuerSubjectKeyID, + ) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse { + const message = createBaseQueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse(); + message.pkiRevocationDistributionPointsByIssuerSubjectKeyID = + (object.pkiRevocationDistributionPointsByIssuerSubjectKeyID !== undefined + && object.pkiRevocationDistributionPointsByIssuerSubjectKeyID !== null) + ? PkiRevocationDistributionPointsByIssuerSubjectKeyID.fromPartial( + object.pkiRevocationDistributionPointsByIssuerSubjectKeyID, + ) + : undefined; + return message; + }, +}; + +function createBaseQueryGetNocRootCertificatesRequest(): QueryGetNocRootCertificatesRequest { + return { vid: 0 }; +} + +export const QueryGetNocRootCertificatesRequest = { + encode(message: QueryGetNocRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.vid !== 0) { + writer.uint32(8).int32(message.vid); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocRootCertificatesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetNocRootCertificatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vid = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetNocRootCertificatesRequest { + return { vid: isSet(object.vid) ? Number(object.vid) : 0 }; + }, + + toJSON(message: QueryGetNocRootCertificatesRequest): unknown { + const obj: any = {}; + message.vid !== undefined && (obj.vid = Math.round(message.vid)); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetNocRootCertificatesRequest { + const message = createBaseQueryGetNocRootCertificatesRequest(); + message.vid = object.vid ?? 0; + return message; + }, +}; + +function createBaseQueryGetNocRootCertificatesResponse(): QueryGetNocRootCertificatesResponse { + return { nocRootCertificates: undefined }; +} + +export const QueryGetNocRootCertificatesResponse = { + encode(message: QueryGetNocRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nocRootCertificates !== undefined) { + NocRootCertificates.encode(message.nocRootCertificates, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocRootCertificatesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetNocRootCertificatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nocRootCertificates = NocRootCertificates.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetNocRootCertificatesResponse { + return { + nocRootCertificates: isSet(object.nocRootCertificates) + ? NocRootCertificates.fromJSON(object.nocRootCertificates) + : undefined, + }; + }, + + toJSON(message: QueryGetNocRootCertificatesResponse): unknown { + const obj: any = {}; + message.nocRootCertificates !== undefined && (obj.nocRootCertificates = message.nocRootCertificates + ? NocRootCertificates.toJSON(message.nocRootCertificates) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetNocRootCertificatesResponse { + const message = createBaseQueryGetNocRootCertificatesResponse(); + message.nocRootCertificates = (object.nocRootCertificates !== undefined && object.nocRootCertificates !== null) + ? NocRootCertificates.fromPartial(object.nocRootCertificates) + : undefined; + return message; + }, +}; + +function createBaseQueryAllNocRootCertificatesRequest(): QueryAllNocRootCertificatesRequest { + return { pagination: undefined }; +} + +export const QueryAllNocRootCertificatesRequest = { + encode(message: QueryAllNocRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllNocRootCertificatesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllNocRootCertificatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllNocRootCertificatesRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryAllNocRootCertificatesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllNocRootCertificatesRequest { + const message = createBaseQueryAllNocRootCertificatesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryAllNocRootCertificatesResponse(): QueryAllNocRootCertificatesResponse { + return { nocRootCertificates: [], pagination: undefined }; +} + +export const QueryAllNocRootCertificatesResponse = { + encode(message: QueryAllNocRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.nocRootCertificates) { + NocRootCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllNocRootCertificatesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllNocRootCertificatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nocRootCertificates.push(NocRootCertificates.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllNocRootCertificatesResponse { + return { + nocRootCertificates: Array.isArray(object?.nocRootCertificates) + ? object.nocRootCertificates.map((e: any) => NocRootCertificates.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryAllNocRootCertificatesResponse): unknown { + const obj: any = {}; + if (message.nocRootCertificates) { + obj.nocRootCertificates = message.nocRootCertificates.map((e) => e ? NocRootCertificates.toJSON(e) : undefined); + } else { + obj.nocRootCertificates = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllNocRootCertificatesResponse { + const message = createBaseQueryAllNocRootCertificatesResponse(); + message.nocRootCertificates = object.nocRootCertificates?.map((e) => NocRootCertificates.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryGetNocIcaCertificatesRequest(): QueryGetNocIcaCertificatesRequest { + return { vid: 0 }; +} + +export const QueryGetNocIcaCertificatesRequest = { + encode(message: QueryGetNocIcaCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.vid !== 0) { + writer.uint32(8).int32(message.vid); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocIcaCertificatesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetNocIcaCertificatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vid = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetNocIcaCertificatesRequest { + return { vid: isSet(object.vid) ? Number(object.vid) : 0 }; + }, + + toJSON(message: QueryGetNocIcaCertificatesRequest): unknown { + const obj: any = {}; + message.vid !== undefined && (obj.vid = Math.round(message.vid)); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetNocIcaCertificatesRequest { + const message = createBaseQueryGetNocIcaCertificatesRequest(); + message.vid = object.vid ?? 0; + return message; + }, +}; + +function createBaseQueryGetNocIcaCertificatesResponse(): QueryGetNocIcaCertificatesResponse { + return { nocIcaCertificates: undefined }; +} + +export const QueryGetNocIcaCertificatesResponse = { + encode(message: QueryGetNocIcaCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nocIcaCertificates !== undefined) { + NocIcaCertificates.encode(message.nocIcaCertificates, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocIcaCertificatesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetNocIcaCertificatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nocIcaCertificates = NocIcaCertificates.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetNocIcaCertificatesResponse { + return { + nocIcaCertificates: isSet(object.nocIcaCertificates) + ? NocIcaCertificates.fromJSON(object.nocIcaCertificates) + : undefined, + }; + }, + + toJSON(message: QueryGetNocIcaCertificatesResponse): unknown { + const obj: any = {}; + message.nocIcaCertificates !== undefined && (obj.nocIcaCertificates = message.nocIcaCertificates + ? NocIcaCertificates.toJSON(message.nocIcaCertificates) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetNocIcaCertificatesResponse { + const message = createBaseQueryGetNocIcaCertificatesResponse(); + message.nocIcaCertificates = (object.nocIcaCertificates !== undefined && object.nocIcaCertificates !== null) + ? NocIcaCertificates.fromPartial(object.nocIcaCertificates) + : undefined; + return message; + }, +}; + +function createBaseQueryAllNocIcaCertificatesRequest(): QueryAllNocIcaCertificatesRequest { + return { pagination: undefined }; +} + +export const QueryAllNocIcaCertificatesRequest = { + encode(message: QueryAllNocIcaCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllNocIcaCertificatesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllNocIcaCertificatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.pagination = PageRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllNocIcaCertificatesRequest { + return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + }, + + toJSON(message: QueryAllNocIcaCertificatesRequest): unknown { + const obj: any = {}; + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllNocIcaCertificatesRequest { + const message = createBaseQueryAllNocIcaCertificatesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryAllNocIcaCertificatesResponse(): QueryAllNocIcaCertificatesResponse { + return { nocIcaCertificates: [], pagination: undefined }; +} + +export const QueryAllNocIcaCertificatesResponse = { + encode(message: QueryAllNocIcaCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.nocIcaCertificates) { + NocIcaCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllNocIcaCertificatesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryAllNocIcaCertificatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nocIcaCertificates.push(NocIcaCertificates.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryAllNocIcaCertificatesResponse { + return { + nocIcaCertificates: Array.isArray(object?.nocIcaCertificates) + ? object.nocIcaCertificates.map((e: any) => NocIcaCertificates.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: QueryAllNocIcaCertificatesResponse): unknown { + const obj: any = {}; + if (message.nocIcaCertificates) { + obj.nocIcaCertificates = message.nocIcaCertificates.map((e) => e ? NocIcaCertificates.toJSON(e) : undefined); + } else { + obj.nocIcaCertificates = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryAllNocIcaCertificatesResponse { + const message = createBaseQueryAllNocIcaCertificatesResponse(); + message.nocIcaCertificates = object.nocIcaCertificates?.map((e) => NocIcaCertificates.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseQueryGetRevokedNocRootCertificatesRequest(): QueryGetRevokedNocRootCertificatesRequest { + return { subject: "", subjectKeyId: "" }; +} + +export const QueryGetRevokedNocRootCertificatesRequest = { + encode(message: QueryGetRevokedNocRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedNocRootCertificatesRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetRevokedNocRootCertificatesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subject = reader.string(); + break; + case 2: + message.subjectKeyId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetRevokedNocRootCertificatesRequest { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + }; + }, + + toJSON(message: QueryGetRevokedNocRootCertificatesRequest): unknown { + const obj: any = {}; + message.subject !== undefined && (obj.subject = message.subject); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetRevokedNocRootCertificatesRequest { + const message = createBaseQueryGetRevokedNocRootCertificatesRequest(); + message.subject = object.subject ?? ""; + message.subjectKeyId = object.subjectKeyId ?? ""; + return message; + }, +}; + +function createBaseQueryGetRevokedNocRootCertificatesResponse(): QueryGetRevokedNocRootCertificatesResponse { + return { revokedNocRootCertificates: undefined }; +} + +export const QueryGetRevokedNocRootCertificatesResponse = { + encode(message: QueryGetRevokedNocRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.revokedNocRootCertificates !== undefined) { + RevokedNocRootCertificates.encode(message.revokedNocRootCertificates, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedNocRootCertificatesResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetRevokedNocRootCertificatesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.revokedNocRootCertificates = RevokedNocRootCertificates.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetRevokedNocRootCertificatesResponse { + return { + revokedNocRootCertificates: isSet(object.revokedNocRootCertificates) + ? RevokedNocRootCertificates.fromJSON(object.revokedNocRootCertificates) + : undefined, + }; + }, + + toJSON(message: QueryGetRevokedNocRootCertificatesResponse): unknown { + const obj: any = {}; + message.revokedNocRootCertificates !== undefined + && (obj.revokedNocRootCertificates = message.revokedNocRootCertificates + ? RevokedNocRootCertificates.toJSON(message.revokedNocRootCertificates) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetNocRootCertificatesResponse { - const message = createBaseQueryGetNocRootCertificatesResponse(); - message.nocRootCertificates = (object.nocRootCertificates !== undefined && object.nocRootCertificates !== null) - ? NocRootCertificates.fromPartial(object.nocRootCertificates) - : undefined; + ): QueryGetRevokedNocRootCertificatesResponse { + const message = createBaseQueryGetRevokedNocRootCertificatesResponse(); + message.revokedNocRootCertificates = + (object.revokedNocRootCertificates !== undefined && object.revokedNocRootCertificates !== null) + ? RevokedNocRootCertificates.fromPartial(object.revokedNocRootCertificates) + : undefined; return message; }, }; -function createBaseQueryAllNocRootCertificatesRequest(): QueryAllNocRootCertificatesRequest { +function createBaseQueryAllRevokedNocRootCertificatesRequest(): QueryAllRevokedNocRootCertificatesRequest { return { pagination: undefined }; } -export const QueryAllNocRootCertificatesRequest = { - encode(message: QueryAllNocRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryAllRevokedNocRootCertificatesRequest = { + encode(message: QueryAllRevokedNocRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllNocRootCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedNocRootCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllNocRootCertificatesRequest(); + const message = createBaseQueryAllRevokedNocRootCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2397,21 +3272,21 @@ export const QueryAllNocRootCertificatesRequest = { return message; }, - fromJSON(object: any): QueryAllNocRootCertificatesRequest { + fromJSON(object: any): QueryAllRevokedNocRootCertificatesRequest { return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, - toJSON(message: QueryAllNocRootCertificatesRequest): unknown { + toJSON(message: QueryAllRevokedNocRootCertificatesRequest): unknown { const obj: any = {}; message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllNocRootCertificatesRequest { - const message = createBaseQueryAllNocRootCertificatesRequest(); + ): QueryAllRevokedNocRootCertificatesRequest { + const message = createBaseQueryAllRevokedNocRootCertificatesRequest(); message.pagination = (object.pagination !== undefined && object.pagination !== null) ? PageRequest.fromPartial(object.pagination) : undefined; @@ -2419,14 +3294,14 @@ export const QueryAllNocRootCertificatesRequest = { }, }; -function createBaseQueryAllNocRootCertificatesResponse(): QueryAllNocRootCertificatesResponse { - return { nocRootCertificates: [], pagination: undefined }; +function createBaseQueryAllRevokedNocRootCertificatesResponse(): QueryAllRevokedNocRootCertificatesResponse { + return { revokedNocRootCertificates: [], pagination: undefined }; } -export const QueryAllNocRootCertificatesResponse = { - encode(message: QueryAllNocRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.nocRootCertificates) { - NocRootCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); +export const QueryAllRevokedNocRootCertificatesResponse = { + encode(message: QueryAllRevokedNocRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.revokedNocRootCertificates) { + RevokedNocRootCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -2434,15 +3309,15 @@ export const QueryAllNocRootCertificatesResponse = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllNocRootCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedNocRootCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllNocRootCertificatesResponse(); + const message = createBaseQueryAllRevokedNocRootCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.nocRootCertificates.push(NocRootCertificates.decode(reader, reader.uint32())); + message.revokedNocRootCertificates.push(RevokedNocRootCertificates.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -2455,32 +3330,35 @@ export const QueryAllNocRootCertificatesResponse = { return message; }, - fromJSON(object: any): QueryAllNocRootCertificatesResponse { + fromJSON(object: any): QueryAllRevokedNocRootCertificatesResponse { return { - nocRootCertificates: Array.isArray(object?.nocRootCertificates) - ? object.nocRootCertificates.map((e: any) => NocRootCertificates.fromJSON(e)) + revokedNocRootCertificates: Array.isArray(object?.revokedNocRootCertificates) + ? object.revokedNocRootCertificates.map((e: any) => RevokedNocRootCertificates.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: QueryAllNocRootCertificatesResponse): unknown { + toJSON(message: QueryAllRevokedNocRootCertificatesResponse): unknown { const obj: any = {}; - if (message.nocRootCertificates) { - obj.nocRootCertificates = message.nocRootCertificates.map((e) => e ? NocRootCertificates.toJSON(e) : undefined); + if (message.revokedNocRootCertificates) { + obj.revokedNocRootCertificates = message.revokedNocRootCertificates.map((e) => + e ? RevokedNocRootCertificates.toJSON(e) : undefined + ); } else { - obj.nocRootCertificates = []; + obj.revokedNocRootCertificates = []; } message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllNocRootCertificatesResponse { - const message = createBaseQueryAllNocRootCertificatesResponse(); - message.nocRootCertificates = object.nocRootCertificates?.map((e) => NocRootCertificates.fromPartial(e)) || []; + ): QueryAllRevokedNocRootCertificatesResponse { + const message = createBaseQueryAllRevokedNocRootCertificatesResponse(); + message.revokedNocRootCertificates = + object.revokedNocRootCertificates?.map((e) => RevokedNocRootCertificates.fromPartial(e)) || []; message.pagination = (object.pagination !== undefined && object.pagination !== null) ? PageResponse.fromPartial(object.pagination) : undefined; @@ -2488,27 +3366,33 @@ export const QueryAllNocRootCertificatesResponse = { }, }; -function createBaseQueryGetNocIcaCertificatesRequest(): QueryGetNocIcaCertificatesRequest { - return { vid: 0 }; +function createBaseQueryGetRevokedNocIcaCertificatesRequest(): QueryGetRevokedNocIcaCertificatesRequest { + return { subject: "", subjectKeyId: "" }; } -export const QueryGetNocIcaCertificatesRequest = { - encode(message: QueryGetNocIcaCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.vid !== 0) { - writer.uint32(8).int32(message.vid); +export const QueryGetRevokedNocIcaCertificatesRequest = { + encode(message: QueryGetRevokedNocIcaCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocIcaCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedNocIcaCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetNocIcaCertificatesRequest(); + const message = createBaseQueryGetRevokedNocIcaCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.vid = reader.int32(); + message.subject = reader.string(); + break; + case 2: + message.subjectKeyId = reader.string(); break; default: reader.skipType(tag & 7); @@ -2518,46 +3402,51 @@ export const QueryGetNocIcaCertificatesRequest = { return message; }, - fromJSON(object: any): QueryGetNocIcaCertificatesRequest { - return { vid: isSet(object.vid) ? Number(object.vid) : 0 }; + fromJSON(object: any): QueryGetRevokedNocIcaCertificatesRequest { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + }; }, - toJSON(message: QueryGetNocIcaCertificatesRequest): unknown { + toJSON(message: QueryGetRevokedNocIcaCertificatesRequest): unknown { const obj: any = {}; - message.vid !== undefined && (obj.vid = Math.round(message.vid)); + message.subject !== undefined && (obj.subject = message.subject); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetNocIcaCertificatesRequest { - const message = createBaseQueryGetNocIcaCertificatesRequest(); - message.vid = object.vid ?? 0; + ): QueryGetRevokedNocIcaCertificatesRequest { + const message = createBaseQueryGetRevokedNocIcaCertificatesRequest(); + message.subject = object.subject ?? ""; + message.subjectKeyId = object.subjectKeyId ?? ""; return message; }, }; -function createBaseQueryGetNocIcaCertificatesResponse(): QueryGetNocIcaCertificatesResponse { - return { nocIcaCertificates: undefined }; +function createBaseQueryGetRevokedNocIcaCertificatesResponse(): QueryGetRevokedNocIcaCertificatesResponse { + return { revokedNocIcaCertificates: undefined }; } -export const QueryGetNocIcaCertificatesResponse = { - encode(message: QueryGetNocIcaCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.nocIcaCertificates !== undefined) { - NocIcaCertificates.encode(message.nocIcaCertificates, writer.uint32(10).fork()).ldelim(); +export const QueryGetRevokedNocIcaCertificatesResponse = { + encode(message: QueryGetRevokedNocIcaCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.revokedNocIcaCertificates !== undefined) { + RevokedNocIcaCertificates.encode(message.revokedNocIcaCertificates, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocIcaCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedNocIcaCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetNocIcaCertificatesResponse(); + const message = createBaseQueryGetRevokedNocIcaCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.nocIcaCertificates = NocIcaCertificates.decode(reader, reader.uint32()); + message.revokedNocIcaCertificates = RevokedNocIcaCertificates.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2567,49 +3456,51 @@ export const QueryGetNocIcaCertificatesResponse = { return message; }, - fromJSON(object: any): QueryGetNocIcaCertificatesResponse { + fromJSON(object: any): QueryGetRevokedNocIcaCertificatesResponse { return { - nocIcaCertificates: isSet(object.nocIcaCertificates) - ? NocIcaCertificates.fromJSON(object.nocIcaCertificates) + revokedNocIcaCertificates: isSet(object.revokedNocIcaCertificates) + ? RevokedNocIcaCertificates.fromJSON(object.revokedNocIcaCertificates) : undefined, }; }, - toJSON(message: QueryGetNocIcaCertificatesResponse): unknown { + toJSON(message: QueryGetRevokedNocIcaCertificatesResponse): unknown { const obj: any = {}; - message.nocIcaCertificates !== undefined && (obj.nocIcaCertificates = message.nocIcaCertificates - ? NocIcaCertificates.toJSON(message.nocIcaCertificates) - : undefined); + message.revokedNocIcaCertificates !== undefined + && (obj.revokedNocIcaCertificates = message.revokedNocIcaCertificates + ? RevokedNocIcaCertificates.toJSON(message.revokedNocIcaCertificates) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetNocIcaCertificatesResponse { - const message = createBaseQueryGetNocIcaCertificatesResponse(); - message.nocIcaCertificates = (object.nocIcaCertificates !== undefined && object.nocIcaCertificates !== null) - ? NocIcaCertificates.fromPartial(object.nocIcaCertificates) - : undefined; + ): QueryGetRevokedNocIcaCertificatesResponse { + const message = createBaseQueryGetRevokedNocIcaCertificatesResponse(); + message.revokedNocIcaCertificates = + (object.revokedNocIcaCertificates !== undefined && object.revokedNocIcaCertificates !== null) + ? RevokedNocIcaCertificates.fromPartial(object.revokedNocIcaCertificates) + : undefined; return message; }, }; -function createBaseQueryAllNocIcaCertificatesRequest(): QueryAllNocIcaCertificatesRequest { +function createBaseQueryAllRevokedNocIcaCertificatesRequest(): QueryAllRevokedNocIcaCertificatesRequest { return { pagination: undefined }; } -export const QueryAllNocIcaCertificatesRequest = { - encode(message: QueryAllNocIcaCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { +export const QueryAllRevokedNocIcaCertificatesRequest = { + encode(message: QueryAllRevokedNocIcaCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.pagination !== undefined) { PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllNocIcaCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedNocIcaCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllNocIcaCertificatesRequest(); + const message = createBaseQueryAllRevokedNocIcaCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2624,21 +3515,21 @@ export const QueryAllNocIcaCertificatesRequest = { return message; }, - fromJSON(object: any): QueryAllNocIcaCertificatesRequest { + fromJSON(object: any): QueryAllRevokedNocIcaCertificatesRequest { return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; }, - toJSON(message: QueryAllNocIcaCertificatesRequest): unknown { + toJSON(message: QueryAllRevokedNocIcaCertificatesRequest): unknown { const obj: any = {}; message.pagination !== undefined && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllNocIcaCertificatesRequest { - const message = createBaseQueryAllNocIcaCertificatesRequest(); + ): QueryAllRevokedNocIcaCertificatesRequest { + const message = createBaseQueryAllRevokedNocIcaCertificatesRequest(); message.pagination = (object.pagination !== undefined && object.pagination !== null) ? PageRequest.fromPartial(object.pagination) : undefined; @@ -2646,14 +3537,14 @@ export const QueryAllNocIcaCertificatesRequest = { }, }; -function createBaseQueryAllNocIcaCertificatesResponse(): QueryAllNocIcaCertificatesResponse { - return { nocIcaCertificates: [], pagination: undefined }; +function createBaseQueryAllRevokedNocIcaCertificatesResponse(): QueryAllRevokedNocIcaCertificatesResponse { + return { revokedNocIcaCertificates: [], pagination: undefined }; } -export const QueryAllNocIcaCertificatesResponse = { - encode(message: QueryAllNocIcaCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.nocIcaCertificates) { - NocIcaCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); +export const QueryAllRevokedNocIcaCertificatesResponse = { + encode(message: QueryAllRevokedNocIcaCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.revokedNocIcaCertificates) { + RevokedNocIcaCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); } if (message.pagination !== undefined) { PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); @@ -2661,15 +3552,15 @@ export const QueryAllNocIcaCertificatesResponse = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllNocIcaCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedNocIcaCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllNocIcaCertificatesResponse(); + const message = createBaseQueryAllRevokedNocIcaCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.nocIcaCertificates.push(NocIcaCertificates.decode(reader, reader.uint32())); + message.revokedNocIcaCertificates.push(RevokedNocIcaCertificates.decode(reader, reader.uint32())); break; case 2: message.pagination = PageResponse.decode(reader, reader.uint32()); @@ -2682,32 +3573,35 @@ export const QueryAllNocIcaCertificatesResponse = { return message; }, - fromJSON(object: any): QueryAllNocIcaCertificatesResponse { + fromJSON(object: any): QueryAllRevokedNocIcaCertificatesResponse { return { - nocIcaCertificates: Array.isArray(object?.nocIcaCertificates) - ? object.nocIcaCertificates.map((e: any) => NocIcaCertificates.fromJSON(e)) + revokedNocIcaCertificates: Array.isArray(object?.revokedNocIcaCertificates) + ? object.revokedNocIcaCertificates.map((e: any) => RevokedNocIcaCertificates.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: QueryAllNocIcaCertificatesResponse): unknown { + toJSON(message: QueryAllRevokedNocIcaCertificatesResponse): unknown { const obj: any = {}; - if (message.nocIcaCertificates) { - obj.nocIcaCertificates = message.nocIcaCertificates.map((e) => e ? NocIcaCertificates.toJSON(e) : undefined); + if (message.revokedNocIcaCertificates) { + obj.revokedNocIcaCertificates = message.revokedNocIcaCertificates.map((e) => + e ? RevokedNocIcaCertificates.toJSON(e) : undefined + ); } else { - obj.nocIcaCertificates = []; + obj.revokedNocIcaCertificates = []; } message.pagination !== undefined && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllNocIcaCertificatesResponse { - const message = createBaseQueryAllNocIcaCertificatesResponse(); - message.nocIcaCertificates = object.nocIcaCertificates?.map((e) => NocIcaCertificates.fromPartial(e)) || []; + ): QueryAllRevokedNocIcaCertificatesResponse { + const message = createBaseQueryAllRevokedNocIcaCertificatesResponse(); + message.revokedNocIcaCertificates = + object.revokedNocIcaCertificates?.map((e) => RevokedNocIcaCertificates.fromPartial(e)) || []; message.pagination = (object.pagination !== undefined && object.pagination !== null) ? PageResponse.fromPartial(object.pagination) : undefined; @@ -2715,14 +3609,133 @@ export const QueryAllNocIcaCertificatesResponse = { }, }; -function createBaseQueryGetRevokedNocRootCertificatesRequest(): QueryGetRevokedNocRootCertificatesRequest { - return { subject: "", subjectKeyId: "" }; +function createBaseQueryGetNocCertificatesByVidAndSkidRequest(): QueryGetNocCertificatesByVidAndSkidRequest { + return { vid: 0, subjectKeyId: "" }; +} + +export const QueryGetNocCertificatesByVidAndSkidRequest = { + encode(message: QueryGetNocCertificatesByVidAndSkidRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.vid !== 0) { + writer.uint32(8).int32(message.vid); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocCertificatesByVidAndSkidRequest { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetNocCertificatesByVidAndSkidRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.vid = reader.int32(); + break; + case 2: + message.subjectKeyId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetNocCertificatesByVidAndSkidRequest { + return { + vid: isSet(object.vid) ? Number(object.vid) : 0, + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + }; + }, + + toJSON(message: QueryGetNocCertificatesByVidAndSkidRequest): unknown { + const obj: any = {}; + message.vid !== undefined && (obj.vid = Math.round(message.vid)); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetNocCertificatesByVidAndSkidRequest { + const message = createBaseQueryGetNocCertificatesByVidAndSkidRequest(); + message.vid = object.vid ?? 0; + message.subjectKeyId = object.subjectKeyId ?? ""; + return message; + }, +}; + +function createBaseQueryGetNocCertificatesByVidAndSkidResponse(): QueryGetNocCertificatesByVidAndSkidResponse { + return { nocCertificatesByVidAndSkid: undefined }; +} + +export const QueryGetNocCertificatesByVidAndSkidResponse = { + encode(message: QueryGetNocCertificatesByVidAndSkidResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nocCertificatesByVidAndSkid !== undefined) { + NocCertificatesByVidAndSkid.encode(message.nocCertificatesByVidAndSkid, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocCertificatesByVidAndSkidResponse { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseQueryGetNocCertificatesByVidAndSkidResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nocCertificatesByVidAndSkid = NocCertificatesByVidAndSkid.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): QueryGetNocCertificatesByVidAndSkidResponse { + return { + nocCertificatesByVidAndSkid: isSet(object.nocCertificatesByVidAndSkid) + ? NocCertificatesByVidAndSkid.fromJSON(object.nocCertificatesByVidAndSkid) + : undefined, + }; + }, + + toJSON(message: QueryGetNocCertificatesByVidAndSkidResponse): unknown { + const obj: any = {}; + message.nocCertificatesByVidAndSkid !== undefined + && (obj.nocCertificatesByVidAndSkid = message.nocCertificatesByVidAndSkid + ? NocCertificatesByVidAndSkid.toJSON(message.nocCertificatesByVidAndSkid) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I, + ): QueryGetNocCertificatesByVidAndSkidResponse { + const message = createBaseQueryGetNocCertificatesByVidAndSkidResponse(); + message.nocCertificatesByVidAndSkid = + (object.nocCertificatesByVidAndSkid !== undefined && object.nocCertificatesByVidAndSkid !== null) + ? NocCertificatesByVidAndSkid.fromPartial(object.nocCertificatesByVidAndSkid) + : undefined; + return message; + }, +}; + +function createBaseQueryNocCertificatesRequest(): QueryNocCertificatesRequest { + return { pagination: undefined, subjectKeyId: "" }; } -export const QueryGetRevokedNocRootCertificatesRequest = { - encode(message: QueryGetRevokedNocRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.subject !== "") { - writer.uint32(10).string(message.subject); +export const QueryNocCertificatesRequest = { + encode(message: QueryNocCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.pagination !== undefined) { + PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); } if (message.subjectKeyId !== "") { writer.uint32(18).string(message.subjectKeyId); @@ -2730,15 +3743,15 @@ export const QueryGetRevokedNocRootCertificatesRequest = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedNocRootCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNocCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetRevokedNocRootCertificatesRequest(); + const message = createBaseQueryNocCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.subject = reader.string(); + message.pagination = PageRequest.decode(reader, reader.uint32()); break; case 2: message.subjectKeyId = reader.string(); @@ -2751,51 +3764,58 @@ export const QueryGetRevokedNocRootCertificatesRequest = { return message; }, - fromJSON(object: any): QueryGetRevokedNocRootCertificatesRequest { + fromJSON(object: any): QueryNocCertificatesRequest { return { - subject: isSet(object.subject) ? String(object.subject) : "", + pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined, subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", }; }, - toJSON(message: QueryGetRevokedNocRootCertificatesRequest): unknown { + toJSON(message: QueryNocCertificatesRequest): unknown { const obj: any = {}; - message.subject !== undefined && (obj.subject = message.subject); + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGetRevokedNocRootCertificatesRequest { - const message = createBaseQueryGetRevokedNocRootCertificatesRequest(); - message.subject = object.subject ?? ""; + fromPartial, I>>(object: I): QueryNocCertificatesRequest { + const message = createBaseQueryNocCertificatesRequest(); + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageRequest.fromPartial(object.pagination) + : undefined; message.subjectKeyId = object.subjectKeyId ?? ""; return message; }, }; -function createBaseQueryGetRevokedNocRootCertificatesResponse(): QueryGetRevokedNocRootCertificatesResponse { - return { revokedNocRootCertificates: undefined }; +function createBaseQueryNocCertificatesResponse(): QueryNocCertificatesResponse { + return { nocCertificates: [], pagination: undefined }; } -export const QueryGetRevokedNocRootCertificatesResponse = { - encode(message: QueryGetRevokedNocRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.revokedNocRootCertificates !== undefined) { - RevokedNocRootCertificates.encode(message.revokedNocRootCertificates, writer.uint32(10).fork()).ldelim(); +export const QueryNocCertificatesResponse = { + encode(message: QueryNocCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.nocCertificates) { + NocCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); + } + if (message.pagination !== undefined) { + PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetRevokedNocRootCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryNocCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetRevokedNocRootCertificatesResponse(); + const message = createBaseQueryNocCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.revokedNocRootCertificates = RevokedNocRootCertificates.decode(reader, reader.uint32()); + message.nocCertificates.push(NocCertificates.decode(reader, reader.uint32())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2805,56 +3825,58 @@ export const QueryGetRevokedNocRootCertificatesResponse = { return message; }, - fromJSON(object: any): QueryGetRevokedNocRootCertificatesResponse { + fromJSON(object: any): QueryNocCertificatesResponse { return { - revokedNocRootCertificates: isSet(object.revokedNocRootCertificates) - ? RevokedNocRootCertificates.fromJSON(object.revokedNocRootCertificates) - : undefined, + nocCertificates: Array.isArray(object?.nocCertificates) + ? object.nocCertificates.map((e: any) => NocCertificates.fromJSON(e)) + : [], + pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: QueryGetRevokedNocRootCertificatesResponse): unknown { + toJSON(message: QueryNocCertificatesResponse): unknown { const obj: any = {}; - message.revokedNocRootCertificates !== undefined - && (obj.revokedNocRootCertificates = message.revokedNocRootCertificates - ? RevokedNocRootCertificates.toJSON(message.revokedNocRootCertificates) - : undefined); + if (message.nocCertificates) { + obj.nocCertificates = message.nocCertificates.map((e) => e ? NocCertificates.toJSON(e) : undefined); + } else { + obj.nocCertificates = []; + } + message.pagination !== undefined + && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); return obj; }, - fromPartial, I>>( - object: I, - ): QueryGetRevokedNocRootCertificatesResponse { - const message = createBaseQueryGetRevokedNocRootCertificatesResponse(); - message.revokedNocRootCertificates = - (object.revokedNocRootCertificates !== undefined && object.revokedNocRootCertificates !== null) - ? RevokedNocRootCertificates.fromPartial(object.revokedNocRootCertificates) - : undefined; + fromPartial, I>>(object: I): QueryNocCertificatesResponse { + const message = createBaseQueryNocCertificatesResponse(); + message.nocCertificates = object.nocCertificates?.map((e) => NocCertificates.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PageResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseQueryAllRevokedNocRootCertificatesRequest(): QueryAllRevokedNocRootCertificatesRequest { - return { pagination: undefined }; +function createBaseQueryGetNocCertificatesBySubjectRequest(): QueryGetNocCertificatesBySubjectRequest { + return { subject: "" }; } -export const QueryAllRevokedNocRootCertificatesRequest = { - encode(message: QueryAllRevokedNocRootCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.pagination !== undefined) { - PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim(); +export const QueryGetNocCertificatesBySubjectRequest = { + encode(message: QueryGetNocCertificatesBySubjectRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedNocRootCertificatesRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocCertificatesBySubjectRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllRevokedNocRootCertificatesRequest(); + const message = createBaseQueryGetNocCertificatesBySubjectRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.pagination = PageRequest.decode(reader, reader.uint32()); + message.subject = reader.string(); break; default: reader.skipType(tag & 7); @@ -2864,55 +3886,46 @@ export const QueryAllRevokedNocRootCertificatesRequest = { return message; }, - fromJSON(object: any): QueryAllRevokedNocRootCertificatesRequest { - return { pagination: isSet(object.pagination) ? PageRequest.fromJSON(object.pagination) : undefined }; + fromJSON(object: any): QueryGetNocCertificatesBySubjectRequest { + return { subject: isSet(object.subject) ? String(object.subject) : "" }; }, - toJSON(message: QueryAllRevokedNocRootCertificatesRequest): unknown { + toJSON(message: QueryGetNocCertificatesBySubjectRequest): unknown { const obj: any = {}; - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageRequest.toJSON(message.pagination) : undefined); + message.subject !== undefined && (obj.subject = message.subject); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllRevokedNocRootCertificatesRequest { - const message = createBaseQueryAllRevokedNocRootCertificatesRequest(); - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageRequest.fromPartial(object.pagination) - : undefined; + ): QueryGetNocCertificatesBySubjectRequest { + const message = createBaseQueryGetNocCertificatesBySubjectRequest(); + message.subject = object.subject ?? ""; return message; }, }; -function createBaseQueryAllRevokedNocRootCertificatesResponse(): QueryAllRevokedNocRootCertificatesResponse { - return { revokedNocRootCertificates: [], pagination: undefined }; +function createBaseQueryGetNocCertificatesBySubjectResponse(): QueryGetNocCertificatesBySubjectResponse { + return { nocCertificatesBySubject: undefined }; } -export const QueryAllRevokedNocRootCertificatesResponse = { - encode(message: QueryAllRevokedNocRootCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.revokedNocRootCertificates) { - RevokedNocRootCertificates.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.pagination !== undefined) { - PageResponse.encode(message.pagination, writer.uint32(18).fork()).ldelim(); +export const QueryGetNocCertificatesBySubjectResponse = { + encode(message: QueryGetNocCertificatesBySubjectResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nocCertificatesBySubject !== undefined) { + NocCertificatesBySubject.encode(message.nocCertificatesBySubject, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryAllRevokedNocRootCertificatesResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocCertificatesBySubjectResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryAllRevokedNocRootCertificatesResponse(); + const message = createBaseQueryGetNocCertificatesBySubjectResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.revokedNocRootCertificates.push(RevokedNocRootCertificates.decode(reader, reader.uint32())); - break; - case 2: - message.pagination = PageResponse.decode(reader, reader.uint32()); + message.nocCertificatesBySubject = NocCertificatesBySubject.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2922,53 +3935,42 @@ export const QueryAllRevokedNocRootCertificatesResponse = { return message; }, - fromJSON(object: any): QueryAllRevokedNocRootCertificatesResponse { + fromJSON(object: any): QueryGetNocCertificatesBySubjectResponse { return { - revokedNocRootCertificates: Array.isArray(object?.revokedNocRootCertificates) - ? object.revokedNocRootCertificates.map((e: any) => RevokedNocRootCertificates.fromJSON(e)) - : [], - pagination: isSet(object.pagination) ? PageResponse.fromJSON(object.pagination) : undefined, + nocCertificatesBySubject: isSet(object.nocCertificatesBySubject) + ? NocCertificatesBySubject.fromJSON(object.nocCertificatesBySubject) + : undefined, }; }, - toJSON(message: QueryAllRevokedNocRootCertificatesResponse): unknown { + toJSON(message: QueryGetNocCertificatesBySubjectResponse): unknown { const obj: any = {}; - if (message.revokedNocRootCertificates) { - obj.revokedNocRootCertificates = message.revokedNocRootCertificates.map((e) => - e ? RevokedNocRootCertificates.toJSON(e) : undefined - ); - } else { - obj.revokedNocRootCertificates = []; - } - message.pagination !== undefined - && (obj.pagination = message.pagination ? PageResponse.toJSON(message.pagination) : undefined); + message.nocCertificatesBySubject !== undefined && (obj.nocCertificatesBySubject = message.nocCertificatesBySubject + ? NocCertificatesBySubject.toJSON(message.nocCertificatesBySubject) + : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryAllRevokedNocRootCertificatesResponse { - const message = createBaseQueryAllRevokedNocRootCertificatesResponse(); - message.revokedNocRootCertificates = - object.revokedNocRootCertificates?.map((e) => RevokedNocRootCertificates.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PageResponse.fromPartial(object.pagination) - : undefined; + ): QueryGetNocCertificatesBySubjectResponse { + const message = createBaseQueryGetNocCertificatesBySubjectResponse(); + message.nocCertificatesBySubject = + (object.nocCertificatesBySubject !== undefined && object.nocCertificatesBySubject !== null) + ? NocCertificatesBySubject.fromPartial(object.nocCertificatesBySubject) + : undefined; return message; }, }; -function createBaseQueryGetNocRootCertificatesByVidAndSkidRequest(): QueryGetNocRootCertificatesByVidAndSkidRequest { - return { vid: 0, subjectKeyId: "" }; +function createBaseQueryGetNocCertificatesRequest(): QueryGetNocCertificatesRequest { + return { subject: "", subjectKeyId: "" }; } -export const QueryGetNocRootCertificatesByVidAndSkidRequest = { - encode( - message: QueryGetNocRootCertificatesByVidAndSkidRequest, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (message.vid !== 0) { - writer.uint32(8).int32(message.vid); +export const QueryGetNocCertificatesRequest = { + encode(message: QueryGetNocCertificatesRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); } if (message.subjectKeyId !== "") { writer.uint32(18).string(message.subjectKeyId); @@ -2976,15 +3978,15 @@ export const QueryGetNocRootCertificatesByVidAndSkidRequest = { return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocRootCertificatesByVidAndSkidRequest { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocCertificatesRequest { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetNocRootCertificatesByVidAndSkidRequest(); + const message = createBaseQueryGetNocCertificatesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.vid = reader.int32(); + message.subject = reader.string(); break; case 2: message.subjectKeyId = reader.string(); @@ -2997,55 +3999,51 @@ export const QueryGetNocRootCertificatesByVidAndSkidRequest = { return message; }, - fromJSON(object: any): QueryGetNocRootCertificatesByVidAndSkidRequest { + fromJSON(object: any): QueryGetNocCertificatesRequest { return { - vid: isSet(object.vid) ? Number(object.vid) : 0, + subject: isSet(object.subject) ? String(object.subject) : "", subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", }; }, - toJSON(message: QueryGetNocRootCertificatesByVidAndSkidRequest): unknown { + toJSON(message: QueryGetNocCertificatesRequest): unknown { const obj: any = {}; - message.vid !== undefined && (obj.vid = Math.round(message.vid)); + message.subject !== undefined && (obj.subject = message.subject); message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetNocRootCertificatesByVidAndSkidRequest { - const message = createBaseQueryGetNocRootCertificatesByVidAndSkidRequest(); - message.vid = object.vid ?? 0; + ): QueryGetNocCertificatesRequest { + const message = createBaseQueryGetNocCertificatesRequest(); + message.subject = object.subject ?? ""; message.subjectKeyId = object.subjectKeyId ?? ""; return message; }, }; -function createBaseQueryGetNocRootCertificatesByVidAndSkidResponse(): QueryGetNocRootCertificatesByVidAndSkidResponse { - return { nocRootCertificatesByVidAndSkid: undefined }; +function createBaseQueryGetNocCertificatesResponse(): QueryGetNocCertificatesResponse { + return { nocCertificates: undefined }; } -export const QueryGetNocRootCertificatesByVidAndSkidResponse = { - encode( - message: QueryGetNocRootCertificatesByVidAndSkidResponse, - writer: _m0.Writer = _m0.Writer.create(), - ): _m0.Writer { - if (message.nocRootCertificatesByVidAndSkid !== undefined) { - NocRootCertificatesByVidAndSkid.encode(message.nocRootCertificatesByVidAndSkid, writer.uint32(10).fork()) - .ldelim(); +export const QueryGetNocCertificatesResponse = { + encode(message: QueryGetNocCertificatesResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.nocCertificates !== undefined) { + NocCertificates.encode(message.nocCertificates, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocRootCertificatesByVidAndSkidResponse { + decode(input: _m0.Reader | Uint8Array, length?: number): QueryGetNocCertificatesResponse { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseQueryGetNocRootCertificatesByVidAndSkidResponse(); + const message = createBaseQueryGetNocCertificatesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.nocRootCertificatesByVidAndSkid = NocRootCertificatesByVidAndSkid.decode(reader, reader.uint32()); + message.nocCertificates = NocCertificates.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3055,41 +4053,48 @@ export const QueryGetNocRootCertificatesByVidAndSkidResponse = { return message; }, - fromJSON(object: any): QueryGetNocRootCertificatesByVidAndSkidResponse { + fromJSON(object: any): QueryGetNocCertificatesResponse { return { - nocRootCertificatesByVidAndSkid: isSet(object.nocRootCertificatesByVidAndSkid) - ? NocRootCertificatesByVidAndSkid.fromJSON(object.nocRootCertificatesByVidAndSkid) - : undefined, + nocCertificates: isSet(object.nocCertificates) ? NocCertificates.fromJSON(object.nocCertificates) : undefined, }; }, - toJSON(message: QueryGetNocRootCertificatesByVidAndSkidResponse): unknown { + toJSON(message: QueryGetNocCertificatesResponse): unknown { const obj: any = {}; - message.nocRootCertificatesByVidAndSkid !== undefined - && (obj.nocRootCertificatesByVidAndSkid = message.nocRootCertificatesByVidAndSkid - ? NocRootCertificatesByVidAndSkid.toJSON(message.nocRootCertificatesByVidAndSkid) - : undefined); + message.nocCertificates !== undefined + && (obj.nocCertificates = message.nocCertificates ? NocCertificates.toJSON(message.nocCertificates) : undefined); return obj; }, - fromPartial, I>>( + fromPartial, I>>( object: I, - ): QueryGetNocRootCertificatesByVidAndSkidResponse { - const message = createBaseQueryGetNocRootCertificatesByVidAndSkidResponse(); - message.nocRootCertificatesByVidAndSkid = - (object.nocRootCertificatesByVidAndSkid !== undefined && object.nocRootCertificatesByVidAndSkid !== null) - ? NocRootCertificatesByVidAndSkid.fromPartial(object.nocRootCertificatesByVidAndSkid) - : undefined; + ): QueryGetNocCertificatesResponse { + const message = createBaseQueryGetNocCertificatesResponse(); + message.nocCertificates = (object.nocCertificates !== undefined && object.nocCertificates !== null) + ? NocCertificates.fromPartial(object.nocCertificates) + : undefined; return message; }, }; /** Query defines the gRPC querier service. */ export interface Query { - /** Queries a ApprovedCertificates by index. */ - ApprovedCertificates(request: QueryGetApprovedCertificatesRequest): Promise; + /** Queries a list of Certificates items. */ + CertificatesAll(request: QueryAllCertificatesRequest): Promise; + /** Queries a AllCertificatesBySubject by index. */ + AllCertificatesBySubject( + request: QueryGetAllCertificatesBySubjectRequest, + ): Promise; + /** Queries a Certificates by index. */ + Certificates(request: QueryGetCertificatesRequest): Promise; /** Queries a list of ApprovedCertificates items. */ ApprovedCertificatesAll(request: QueryAllApprovedCertificatesRequest): Promise; + /** Queries a ApprovedCertificatesBySubject by index. */ + ApprovedCertificatesBySubject( + request: QueryGetApprovedCertificatesBySubjectRequest, + ): Promise; + /** Queries a ApprovedCertificates by index. */ + ApprovedCertificates(request: QueryGetApprovedCertificatesRequest): Promise; /** Queries a ProposedCertificate by index. */ ProposedCertificate(request: QueryGetProposedCertificateRequest): Promise; /** Queries a list of ProposedCertificate items. */ @@ -3116,10 +4121,6 @@ export interface Query { RevokedRootCertificates( request: QueryGetRevokedRootCertificatesRequest, ): Promise; - /** Queries a ApprovedCertificatesBySubject by index. */ - ApprovedCertificatesBySubject( - request: QueryGetApprovedCertificatesBySubjectRequest, - ): Promise; /** Queries a RejectedCertificate by index. */ RejectedCertificate(request: QueryGetRejectedCertificatesRequest): Promise; /** Queries a list of RejectedCertificate items. */ @@ -3136,12 +4137,20 @@ export interface Query { PkiRevocationDistributionPointsByIssuerSubjectKeyID( request: QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest, ): Promise; + /** Queries a list of NocCertificates items. */ + NocCertificatesAll(request: QueryNocCertificatesRequest): Promise; + /** Queries a NocCertificatesBySubject by index. */ + NocCertificatesBySubject( + request: QueryGetNocCertificatesBySubjectRequest, + ): Promise; + /** Queries a NocCertificates by index. */ + NocCertificates(request: QueryGetNocCertificatesRequest): Promise; + /** Queries a NocCertificatesByVidAndSkid by index. */ + NocCertificatesByVidAndSkid( + request: QueryGetNocCertificatesByVidAndSkidRequest, + ): Promise; /** Queries a NocRootCertificates by index. */ NocRootCertificates(request: QueryGetNocRootCertificatesRequest): Promise; - /** Queries a NocRootCertificatesByVidAndSkid by index. */ - NocRootCertificatesByVidAndSkid( - request: QueryGetNocRootCertificatesByVidAndSkidRequest, - ): Promise; /** Queries a list of NocRootCertificates items. */ NocRootCertificatesAll(request: QueryAllNocRootCertificatesRequest): Promise; /** Queries a NocIcaCertificates by index. */ @@ -3156,14 +4165,26 @@ export interface Query { RevokedNocRootCertificatesAll( request: QueryAllRevokedNocRootCertificatesRequest, ): Promise; + /** Queries a RevokedNocIcaCertificates by index. */ + RevokedNocIcaCertificates( + request: QueryGetRevokedNocIcaCertificatesRequest, + ): Promise; + /** Queries a list of RevokedNocIcaCertificates items. */ + RevokedNocIcaCertificatesAll( + request: QueryAllRevokedNocIcaCertificatesRequest, + ): Promise; } export class QueryClientImpl implements Query { private readonly rpc: Rpc; constructor(rpc: Rpc) { this.rpc = rpc; - this.ApprovedCertificates = this.ApprovedCertificates.bind(this); + this.CertificatesAll = this.CertificatesAll.bind(this); + this.AllCertificatesBySubject = this.AllCertificatesBySubject.bind(this); + this.Certificates = this.Certificates.bind(this); this.ApprovedCertificatesAll = this.ApprovedCertificatesAll.bind(this); + this.ApprovedCertificatesBySubject = this.ApprovedCertificatesBySubject.bind(this); + this.ApprovedCertificates = this.ApprovedCertificates.bind(this); this.ProposedCertificate = this.ProposedCertificate.bind(this); this.ProposedCertificateAll = this.ProposedCertificateAll.bind(this); this.ChildCertificates = this.ChildCertificates.bind(this); @@ -3173,29 +4194,47 @@ export class QueryClientImpl implements Query { this.RevokedCertificatesAll = this.RevokedCertificatesAll.bind(this); this.ApprovedRootCertificates = this.ApprovedRootCertificates.bind(this); this.RevokedRootCertificates = this.RevokedRootCertificates.bind(this); - this.ApprovedCertificatesBySubject = this.ApprovedCertificatesBySubject.bind(this); this.RejectedCertificate = this.RejectedCertificate.bind(this); this.RejectedCertificateAll = this.RejectedCertificateAll.bind(this); this.PkiRevocationDistributionPoint = this.PkiRevocationDistributionPoint.bind(this); this.PkiRevocationDistributionPointAll = this.PkiRevocationDistributionPointAll.bind(this); this.PkiRevocationDistributionPointsByIssuerSubjectKeyID = this.PkiRevocationDistributionPointsByIssuerSubjectKeyID .bind(this); + this.NocCertificatesAll = this.NocCertificatesAll.bind(this); + this.NocCertificatesBySubject = this.NocCertificatesBySubject.bind(this); + this.NocCertificates = this.NocCertificates.bind(this); + this.NocCertificatesByVidAndSkid = this.NocCertificatesByVidAndSkid.bind(this); this.NocRootCertificates = this.NocRootCertificates.bind(this); - this.NocRootCertificatesByVidAndSkid = this.NocRootCertificatesByVidAndSkid.bind(this); this.NocRootCertificatesAll = this.NocRootCertificatesAll.bind(this); this.NocIcaCertificates = this.NocIcaCertificates.bind(this); this.NocIcaCertificatesAll = this.NocIcaCertificatesAll.bind(this); this.RevokedNocRootCertificates = this.RevokedNocRootCertificates.bind(this); this.RevokedNocRootCertificatesAll = this.RevokedNocRootCertificatesAll.bind(this); + this.RevokedNocIcaCertificates = this.RevokedNocIcaCertificates.bind(this); + this.RevokedNocIcaCertificatesAll = this.RevokedNocIcaCertificatesAll.bind(this); } - ApprovedCertificates(request: QueryGetApprovedCertificatesRequest): Promise { - const data = QueryGetApprovedCertificatesRequest.encode(request).finish(); + CertificatesAll(request: QueryAllCertificatesRequest): Promise { + const data = QueryAllCertificatesRequest.encode(request).finish(); + const promise = this.rpc.request("zigbeealliance.distributedcomplianceledger.pki.Query", "CertificatesAll", data); + return promise.then((data) => QueryAllCertificatesResponse.decode(new _m0.Reader(data))); + } + + AllCertificatesBySubject( + request: QueryGetAllCertificatesBySubjectRequest, + ): Promise { + const data = QueryGetAllCertificatesBySubjectRequest.encode(request).finish(); const promise = this.rpc.request( "zigbeealliance.distributedcomplianceledger.pki.Query", - "ApprovedCertificates", + "AllCertificatesBySubject", data, ); - return promise.then((data) => QueryGetApprovedCertificatesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGetAllCertificatesBySubjectResponse.decode(new _m0.Reader(data))); + } + + Certificates(request: QueryGetCertificatesRequest): Promise { + const data = QueryGetCertificatesRequest.encode(request).finish(); + const promise = this.rpc.request("zigbeealliance.distributedcomplianceledger.pki.Query", "Certificates", data); + return promise.then((data) => QueryGetCertificatesResponse.decode(new _m0.Reader(data))); } ApprovedCertificatesAll(request: QueryAllApprovedCertificatesRequest): Promise { @@ -3208,6 +4247,28 @@ export class QueryClientImpl implements Query { return promise.then((data) => QueryAllApprovedCertificatesResponse.decode(new _m0.Reader(data))); } + ApprovedCertificatesBySubject( + request: QueryGetApprovedCertificatesBySubjectRequest, + ): Promise { + const data = QueryGetApprovedCertificatesBySubjectRequest.encode(request).finish(); + const promise = this.rpc.request( + "zigbeealliance.distributedcomplianceledger.pki.Query", + "ApprovedCertificatesBySubject", + data, + ); + return promise.then((data) => QueryGetApprovedCertificatesBySubjectResponse.decode(new _m0.Reader(data))); + } + + ApprovedCertificates(request: QueryGetApprovedCertificatesRequest): Promise { + const data = QueryGetApprovedCertificatesRequest.encode(request).finish(); + const promise = this.rpc.request( + "zigbeealliance.distributedcomplianceledger.pki.Query", + "ApprovedCertificates", + data, + ); + return promise.then((data) => QueryGetApprovedCertificatesResponse.decode(new _m0.Reader(data))); + } + ProposedCertificate(request: QueryGetProposedCertificateRequest): Promise { const data = QueryGetProposedCertificateRequest.encode(request).finish(); const promise = this.rpc.request( @@ -3302,18 +4363,6 @@ export class QueryClientImpl implements Query { return promise.then((data) => QueryGetRevokedRootCertificatesResponse.decode(new _m0.Reader(data))); } - ApprovedCertificatesBySubject( - request: QueryGetApprovedCertificatesBySubjectRequest, - ): Promise { - const data = QueryGetApprovedCertificatesBySubjectRequest.encode(request).finish(); - const promise = this.rpc.request( - "zigbeealliance.distributedcomplianceledger.pki.Query", - "ApprovedCertificatesBySubject", - data, - ); - return promise.then((data) => QueryGetApprovedCertificatesBySubjectResponse.decode(new _m0.Reader(data))); - } - RejectedCertificate(request: QueryGetRejectedCertificatesRequest): Promise { const data = QueryGetRejectedCertificatesRequest.encode(request).finish(); const promise = this.rpc.request( @@ -3372,26 +4421,54 @@ export class QueryClientImpl implements Query { ); } - NocRootCertificates(request: QueryGetNocRootCertificatesRequest): Promise { - const data = QueryGetNocRootCertificatesRequest.encode(request).finish(); + NocCertificatesAll(request: QueryNocCertificatesRequest): Promise { + const data = QueryNocCertificatesRequest.encode(request).finish(); const promise = this.rpc.request( "zigbeealliance.distributedcomplianceledger.pki.Query", - "NocRootCertificates", + "NocCertificatesAll", data, ); - return promise.then((data) => QueryGetNocRootCertificatesResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryNocCertificatesResponse.decode(new _m0.Reader(data))); + } + + NocCertificatesBySubject( + request: QueryGetNocCertificatesBySubjectRequest, + ): Promise { + const data = QueryGetNocCertificatesBySubjectRequest.encode(request).finish(); + const promise = this.rpc.request( + "zigbeealliance.distributedcomplianceledger.pki.Query", + "NocCertificatesBySubject", + data, + ); + return promise.then((data) => QueryGetNocCertificatesBySubjectResponse.decode(new _m0.Reader(data))); + } + + NocCertificates(request: QueryGetNocCertificatesRequest): Promise { + const data = QueryGetNocCertificatesRequest.encode(request).finish(); + const promise = this.rpc.request("zigbeealliance.distributedcomplianceledger.pki.Query", "NocCertificates", data); + return promise.then((data) => QueryGetNocCertificatesResponse.decode(new _m0.Reader(data))); + } + + NocCertificatesByVidAndSkid( + request: QueryGetNocCertificatesByVidAndSkidRequest, + ): Promise { + const data = QueryGetNocCertificatesByVidAndSkidRequest.encode(request).finish(); + const promise = this.rpc.request( + "zigbeealliance.distributedcomplianceledger.pki.Query", + "NocCertificatesByVidAndSkid", + data, + ); + return promise.then((data) => QueryGetNocCertificatesByVidAndSkidResponse.decode(new _m0.Reader(data))); } - NocRootCertificatesByVidAndSkid( - request: QueryGetNocRootCertificatesByVidAndSkidRequest, - ): Promise { - const data = QueryGetNocRootCertificatesByVidAndSkidRequest.encode(request).finish(); + NocRootCertificates(request: QueryGetNocRootCertificatesRequest): Promise { + const data = QueryGetNocRootCertificatesRequest.encode(request).finish(); const promise = this.rpc.request( "zigbeealliance.distributedcomplianceledger.pki.Query", - "NocRootCertificatesByVidAndSkid", + "NocRootCertificates", data, ); - return promise.then((data) => QueryGetNocRootCertificatesByVidAndSkidResponse.decode(new _m0.Reader(data))); + return promise.then((data) => QueryGetNocRootCertificatesResponse.decode(new _m0.Reader(data))); } NocRootCertificatesAll(request: QueryAllNocRootCertificatesRequest): Promise { @@ -3447,6 +4524,30 @@ export class QueryClientImpl implements Query { ); return promise.then((data) => QueryAllRevokedNocRootCertificatesResponse.decode(new _m0.Reader(data))); } + + RevokedNocIcaCertificates( + request: QueryGetRevokedNocIcaCertificatesRequest, + ): Promise { + const data = QueryGetRevokedNocIcaCertificatesRequest.encode(request).finish(); + const promise = this.rpc.request( + "zigbeealliance.distributedcomplianceledger.pki.Query", + "RevokedNocIcaCertificates", + data, + ); + return promise.then((data) => QueryGetRevokedNocIcaCertificatesResponse.decode(new _m0.Reader(data))); + } + + RevokedNocIcaCertificatesAll( + request: QueryAllRevokedNocIcaCertificatesRequest, + ): Promise { + const data = QueryAllRevokedNocIcaCertificatesRequest.encode(request).finish(); + const promise = this.rpc.request( + "zigbeealliance.distributedcomplianceledger.pki.Query", + "RevokedNocIcaCertificatesAll", + data, + ); + return promise.then((data) => QueryAllRevokedNocIcaCertificatesResponse.decode(new _m0.Reader(data))); + } } interface Rpc { diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/revoked_noc_ica_certificates.ts b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/revoked_noc_ica_certificates.ts new file mode 100644 index 000000000..54da420cc --- /dev/null +++ b/ts-client/zigbeealliance.distributedcomplianceledger.pki/types/zigbeealliance/distributedcomplianceledger/pki/revoked_noc_ica_certificates.ts @@ -0,0 +1,107 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; +import { Certificate } from "./certificate"; + +export const protobufPackage = "zigbeealliance.distributedcomplianceledger.pki"; + +export interface RevokedNocIcaCertificates { + subject: string; + subjectKeyId: string; + certs: Certificate[]; + schemaVersion: number; +} + +function createBaseRevokedNocIcaCertificates(): RevokedNocIcaCertificates { + return { subject: "", subjectKeyId: "", certs: [], schemaVersion: 0 }; +} + +export const RevokedNocIcaCertificates = { + encode(message: RevokedNocIcaCertificates, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.subject !== "") { + writer.uint32(10).string(message.subject); + } + if (message.subjectKeyId !== "") { + writer.uint32(18).string(message.subjectKeyId); + } + for (const v of message.certs) { + Certificate.encode(v!, writer.uint32(26).fork()).ldelim(); + } + if (message.schemaVersion !== 0) { + writer.uint32(32).uint32(message.schemaVersion); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RevokedNocIcaCertificates { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRevokedNocIcaCertificates(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.subject = reader.string(); + break; + case 2: + message.subjectKeyId = reader.string(); + break; + case 3: + message.certs.push(Certificate.decode(reader, reader.uint32())); + break; + case 4: + message.schemaVersion = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RevokedNocIcaCertificates { + return { + subject: isSet(object.subject) ? String(object.subject) : "", + subjectKeyId: isSet(object.subjectKeyId) ? String(object.subjectKeyId) : "", + certs: Array.isArray(object?.certs) ? object.certs.map((e: any) => Certificate.fromJSON(e)) : [], + schemaVersion: isSet(object.schemaVersion) ? Number(object.schemaVersion) : 0, + }; + }, + + toJSON(message: RevokedNocIcaCertificates): unknown { + const obj: any = {}; + message.subject !== undefined && (obj.subject = message.subject); + message.subjectKeyId !== undefined && (obj.subjectKeyId = message.subjectKeyId); + if (message.certs) { + obj.certs = message.certs.map((e) => e ? Certificate.toJSON(e) : undefined); + } else { + obj.certs = []; + } + message.schemaVersion !== undefined && (obj.schemaVersion = Math.round(message.schemaVersion)); + return obj; + }, + + fromPartial, I>>(object: I): RevokedNocIcaCertificates { + const message = createBaseRevokedNocIcaCertificates(); + message.subject = object.subject ?? ""; + message.subjectKeyId = object.subjectKeyId ?? ""; + message.certs = object.certs?.map((e) => Certificate.fromPartial(e)) || []; + message.schemaVersion = object.schemaVersion ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +export type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.validator/module.ts b/ts-client/zigbeealliance.distributedcomplianceledger.validator/module.ts index 37803b1b8..8b11f0427 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.validator/module.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.validator/module.ts @@ -7,12 +7,12 @@ import { msgTypes } from './registry'; import { IgniteClient } from "../client" import { MissingWalletError } from "../helpers" import { Api } from "./rest"; +import { MsgApproveDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; import { MsgCreateValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; -import { MsgRejectDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; +import { MsgDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; import { MsgEnableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; -import { MsgApproveDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; +import { MsgRejectDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; import { MsgProposeDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; -import { MsgDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; import { Description as typeDescription} from "./types" import { DisabledValidator as typeDisabledValidator} from "./types" @@ -22,7 +22,13 @@ import { ProposedDisableValidator as typeProposedDisableValidator} from "./types import { RejectedDisableValidator as typeRejectedDisableValidator} from "./types" import { Validator as typeValidator} from "./types" -export { MsgCreateValidator, MsgRejectDisableValidator, MsgEnableValidator, MsgApproveDisableValidator, MsgProposeDisableValidator, MsgDisableValidator }; +export { MsgApproveDisableValidator, MsgCreateValidator, MsgDisableValidator, MsgEnableValidator, MsgRejectDisableValidator, MsgProposeDisableValidator }; + +type sendMsgApproveDisableValidatorParams = { + value: MsgApproveDisableValidator, + fee?: StdFee, + memo?: string +}; type sendMsgCreateValidatorParams = { value: MsgCreateValidator, @@ -30,8 +36,8 @@ type sendMsgCreateValidatorParams = { memo?: string }; -type sendMsgRejectDisableValidatorParams = { - value: MsgRejectDisableValidator, +type sendMsgDisableValidatorParams = { + value: MsgDisableValidator, fee?: StdFee, memo?: string }; @@ -42,8 +48,8 @@ type sendMsgEnableValidatorParams = { memo?: string }; -type sendMsgApproveDisableValidatorParams = { - value: MsgApproveDisableValidator, +type sendMsgRejectDisableValidatorParams = { + value: MsgRejectDisableValidator, fee?: StdFee, memo?: string }; @@ -54,37 +60,31 @@ type sendMsgProposeDisableValidatorParams = { memo?: string }; -type sendMsgDisableValidatorParams = { - value: MsgDisableValidator, - fee?: StdFee, - memo?: string -}; +type msgApproveDisableValidatorParams = { + value: MsgApproveDisableValidator, +}; type msgCreateValidatorParams = { value: MsgCreateValidator, }; -type msgRejectDisableValidatorParams = { - value: MsgRejectDisableValidator, +type msgDisableValidatorParams = { + value: MsgDisableValidator, }; type msgEnableValidatorParams = { value: MsgEnableValidator, }; -type msgApproveDisableValidatorParams = { - value: MsgApproveDisableValidator, +type msgRejectDisableValidatorParams = { + value: MsgRejectDisableValidator, }; type msgProposeDisableValidatorParams = { value: MsgProposeDisableValidator, }; -type msgDisableValidatorParams = { - value: MsgDisableValidator, -}; - export const registry = new Registry(msgTypes); @@ -115,6 +115,20 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht return { + async sendMsgApproveDisableValidator({ value, fee, memo }: sendMsgApproveDisableValidatorParams): Promise { + if (!signer) { + throw new Error('TxClient:sendMsgApproveDisableValidator: Unable to sign Tx. Signer is not present.') + } + try { + const { address } = (await signer.getAccounts())[0]; + const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); + let msg = this.msgApproveDisableValidator({ value: MsgApproveDisableValidator.fromPartial(value) }) + return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + } catch (e: any) { + throw new Error('TxClient:sendMsgApproveDisableValidator: Could not broadcast Tx: '+ e.message) + } + }, + async sendMsgCreateValidator({ value, fee, memo }: sendMsgCreateValidatorParams): Promise { if (!signer) { throw new Error('TxClient:sendMsgCreateValidator: Unable to sign Tx. Signer is not present.') @@ -129,17 +143,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgRejectDisableValidator({ value, fee, memo }: sendMsgRejectDisableValidatorParams): Promise { + async sendMsgDisableValidator({ value, fee, memo }: sendMsgDisableValidatorParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgRejectDisableValidator: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgDisableValidator: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgRejectDisableValidator({ value: MsgRejectDisableValidator.fromPartial(value) }) + let msg = this.msgDisableValidator({ value: MsgDisableValidator.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgRejectDisableValidator: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgDisableValidator: Could not broadcast Tx: '+ e.message) } }, @@ -157,17 +171,17 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgApproveDisableValidator({ value, fee, memo }: sendMsgApproveDisableValidatorParams): Promise { + async sendMsgRejectDisableValidator({ value, fee, memo }: sendMsgRejectDisableValidatorParams): Promise { if (!signer) { - throw new Error('TxClient:sendMsgApproveDisableValidator: Unable to sign Tx. Signer is not present.') + throw new Error('TxClient:sendMsgRejectDisableValidator: Unable to sign Tx. Signer is not present.') } try { const { address } = (await signer.getAccounts())[0]; const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgApproveDisableValidator({ value: MsgApproveDisableValidator.fromPartial(value) }) + let msg = this.msgRejectDisableValidator({ value: MsgRejectDisableValidator.fromPartial(value) }) return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) } catch (e: any) { - throw new Error('TxClient:sendMsgApproveDisableValidator: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:sendMsgRejectDisableValidator: Could not broadcast Tx: '+ e.message) } }, @@ -185,21 +199,15 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - async sendMsgDisableValidator({ value, fee, memo }: sendMsgDisableValidatorParams): Promise { - if (!signer) { - throw new Error('TxClient:sendMsgDisableValidator: Unable to sign Tx. Signer is not present.') - } - try { - const { address } = (await signer.getAccounts())[0]; - const signingClient = await SigningStargateClient.connectWithSigner(addr,signer,{registry, prefix}); - let msg = this.msgDisableValidator({ value: MsgDisableValidator.fromPartial(value) }) - return await signingClient.signAndBroadcast(address, [msg], fee ? fee : defaultFee, memo) + + msgApproveDisableValidator({ value }: msgApproveDisableValidatorParams): EncodeObject { + try { + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.validator.MsgApproveDisableValidator", value: MsgApproveDisableValidator.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:sendMsgDisableValidator: Could not broadcast Tx: '+ e.message) + throw new Error('TxClient:MsgApproveDisableValidator: Could not create message: ' + e.message) } }, - msgCreateValidator({ value }: msgCreateValidatorParams): EncodeObject { try { return { typeUrl: "/zigbeealliance.distributedcomplianceledger.validator.MsgCreateValidator", value: MsgCreateValidator.fromPartial( value ) } @@ -208,11 +216,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgRejectDisableValidator({ value }: msgRejectDisableValidatorParams): EncodeObject { + msgDisableValidator({ value }: msgDisableValidatorParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.validator.MsgRejectDisableValidator", value: MsgRejectDisableValidator.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.validator.MsgDisableValidator", value: MsgDisableValidator.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgRejectDisableValidator: Could not create message: ' + e.message) + throw new Error('TxClient:MsgDisableValidator: Could not create message: ' + e.message) } }, @@ -224,11 +232,11 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgApproveDisableValidator({ value }: msgApproveDisableValidatorParams): EncodeObject { + msgRejectDisableValidator({ value }: msgRejectDisableValidatorParams): EncodeObject { try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.validator.MsgApproveDisableValidator", value: MsgApproveDisableValidator.fromPartial( value ) } + return { typeUrl: "/zigbeealliance.distributedcomplianceledger.validator.MsgRejectDisableValidator", value: MsgRejectDisableValidator.fromPartial( value ) } } catch (e: any) { - throw new Error('TxClient:MsgApproveDisableValidator: Could not create message: ' + e.message) + throw new Error('TxClient:MsgRejectDisableValidator: Could not create message: ' + e.message) } }, @@ -240,14 +248,6 @@ export const txClient = ({ signer, prefix, addr }: TxClientOptions = { addr: "ht } }, - msgDisableValidator({ value }: msgDisableValidatorParams): EncodeObject { - try { - return { typeUrl: "/zigbeealliance.distributedcomplianceledger.validator.MsgDisableValidator", value: MsgDisableValidator.fromPartial( value ) } - } catch (e: any) { - throw new Error('TxClient:MsgDisableValidator: Could not create message: ' + e.message) - } - }, - } }; diff --git a/ts-client/zigbeealliance.distributedcomplianceledger.validator/registry.ts b/ts-client/zigbeealliance.distributedcomplianceledger.validator/registry.ts index 3075b03dc..5af8e5b4f 100755 --- a/ts-client/zigbeealliance.distributedcomplianceledger.validator/registry.ts +++ b/ts-client/zigbeealliance.distributedcomplianceledger.validator/registry.ts @@ -1,18 +1,18 @@ import { GeneratedType } from "@cosmjs/proto-signing"; +import { MsgApproveDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; import { MsgCreateValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; -import { MsgRejectDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; +import { MsgDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; import { MsgEnableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; -import { MsgApproveDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; +import { MsgRejectDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; import { MsgProposeDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; -import { MsgDisableValidator } from "./types/zigbeealliance/distributedcomplianceledger/validator/tx"; const msgTypes: Array<[string, GeneratedType]> = [ + ["/zigbeealliance.distributedcomplianceledger.validator.MsgApproveDisableValidator", MsgApproveDisableValidator], ["/zigbeealliance.distributedcomplianceledger.validator.MsgCreateValidator", MsgCreateValidator], - ["/zigbeealliance.distributedcomplianceledger.validator.MsgRejectDisableValidator", MsgRejectDisableValidator], + ["/zigbeealliance.distributedcomplianceledger.validator.MsgDisableValidator", MsgDisableValidator], ["/zigbeealliance.distributedcomplianceledger.validator.MsgEnableValidator", MsgEnableValidator], - ["/zigbeealliance.distributedcomplianceledger.validator.MsgApproveDisableValidator", MsgApproveDisableValidator], + ["/zigbeealliance.distributedcomplianceledger.validator.MsgRejectDisableValidator", MsgRejectDisableValidator], ["/zigbeealliance.distributedcomplianceledger.validator.MsgProposeDisableValidator", MsgProposeDisableValidator], - ["/zigbeealliance.distributedcomplianceledger.validator.MsgDisableValidator", MsgDisableValidator], ]; diff --git a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/rest.ts b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/rest.ts index 6ef490e38..057f5b520 100644 --- a/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/rest.ts +++ b/vue/src/store/generated/zigbee-alliance/distributed-compliance-ledger/zigbeealliance.distributedcomplianceledger.pki/module/rest.ts @@ -787,11 +787,11 @@ export class Api extends HttpClient this.request({ - path: `/dcl/pki/noc-ica-certificates/${vid}`, + path: `/dcl/pki/noc-vid-ica-certificates/${vid}`, method: "GET", format: "json", ...params, @@ -829,11 +829,11 @@ export class Api extends HttpClient this.request({ - path: `/dcl/pki/noc-root-certificates/${vid}`, + path: `/dcl/pki/noc-vid-root-certificates/${vid}`, method: "GET", format: "json", ...params, @@ -845,11 +845,11 @@ export class Api extends HttpClient this.request({ - path: `/dcl/pki/noc-root-certificates/${vid}/${subjectKeyId}`, + path: `/dcl/pki/noc-vid-root-certificates/${vid}/${subjectKeyId}`, method: "GET", format: "json", ...params, diff --git a/x/pki/client/cli/query.go b/x/pki/client/cli/query.go index e3630b7c4..06f9f295f 100644 --- a/x/pki/client/cli/query.go +++ b/x/pki/client/cli/query.go @@ -53,6 +53,7 @@ func GetQueryCmd(_ string) *cobra.Command { cmd.AddCommand(CmdShowCertificates()) cmd.AddCommand(CmdListRevokedNocIcaCertificates()) cmd.AddCommand(CmdShowRevokedNocIcaCertificates()) + cmd.AddCommand(CmdListAllCertificatesBySubject()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/pki/client/cli/query_all_certificates_by_subject.go b/x/pki/client/cli/query_all_certificates_by_subject.go new file mode 100644 index 000000000..7c8d79356 --- /dev/null +++ b/x/pki/client/cli/query_all_certificates_by_subject.go @@ -0,0 +1,43 @@ +package cli + +import ( + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/spf13/cobra" + pkitypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/pki" + "github.com/zigbee-alliance/distributed-compliance-ledger/utils/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" +) + +func CmdListAllCertificatesBySubject() *cobra.Command { + var subject string + + cmd := &cobra.Command{ + Use: "all-subject-certs", + Short: "Gets all certificates (DA and Noc) associated with subject", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + var res types.AllCertificatesBySubject + + return cli.QueryWithProof( + clientCtx, + pkitypes.StoreKey, + types.AllCertificatesBySubjectKeyPrefix, + types.AllCertificatesBySubjectKey(subject), + &res, + ) + }, + } + + cmd.Flags().StringVarP(&subject, FlagSubject, FlagSubjectShortcut, "", "Certificate's subject") + flags.AddQueryFlagsToCmd(cmd) + + _ = cmd.MarkFlagRequired(FlagSubject) + + return cmd +} diff --git a/x/pki/client/cli/query_all_certificates_by_subject_test.go b/x/pki/client/cli/query_all_certificates_by_subject_test.go new file mode 100644 index 000000000..9393f5a82 --- /dev/null +++ b/x/pki/client/cli/query_all_certificates_by_subject_test.go @@ -0,0 +1,162 @@ +package cli_test + +/*import ( + "fmt" + "strconv" + "testing" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/stretchr/testify/require" + tmcli "github.com/cometbft/cometbft/libs/cli" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + + "github.com/zigbee-alliance/distributed-compliance-ledger/testutil/network" + "github.com/zigbee-alliance/distributed-compliance-ledger/testutil/nullify" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/client/cli" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func networkWithAllCertificatesBySubjectObjects(t *testing.T, n int) (*network.Network, []types.AllCertificatesBySubject) { + t.Helper() + cfg := network.DefaultConfig() + state := types.GenesisState{} + for i := 0; i < n; i++ { + allCertificatesBySubject := types.AllCertificatesBySubject{ + Subject: strconv.Itoa(i), + + } + nullify.Fill(&allCertificatesBySubject) + state.AllCertificatesBySubjectList = append(state.AllCertificatesBySubjectList, allCertificatesBySubject) + } + buf, err := cfg.Codec.MarshalJSON(&state) + require.NoError(t, err) + cfg.GenesisState[types.ModuleName] = buf + return network.New(t, cfg), state.AllCertificatesBySubjectList +} + +func TestShowAllCertificatesBySubject(t *testing.T) { + net, objs := networkWithAllCertificatesBySubjectObjects(t, 2) + + ctx := net.Validators[0].ClientCtx + common := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + tests := []struct { + desc string + idSubject string + + args []string + err error + obj types.AllCertificatesBySubject + }{ + { + desc: "found", + idSubject: objs[0].Subject, + + args: common, + obj: objs[0], + }, + { + desc: "not found", + idSubject: strconv.Itoa(100000), + + args: common, + err: status.Error(codes.NotFound, "not found"), + }, + } + for _, tc := range tests { + t.Run(tc.desc, func(t *testing.T) { + args := []string{ + tc.idSubject, + + } + args = append(args, tc.args...) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdShowAllCertificatesBySubject(), args) + if tc.err != nil { + stat, ok := status.FromError(tc.err) + require.True(t, ok) + require.ErrorIs(t, stat.Err(), tc.err) + } else { + require.NoError(t, err) + var resp types.QueryGetAllCertificatesBySubjectResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NotNil(t, resp.AllCertificatesBySubject) + require.Equal(t, + nullify.Fill(&tc.obj), + nullify.Fill(&resp.AllCertificatesBySubject), + ) + } + }) + } +} + +func TestListAllCertificatesBySubject(t *testing.T) { + net, objs := networkWithAllCertificatesBySubjectObjects(t, 5) + + ctx := net.Validators[0].ClientCtx + request := func(next []byte, offset, limit uint64, total bool) []string { + args := []string{ + fmt.Sprintf("--%s=json", tmcli.OutputFlag), + } + if next == nil { + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagOffset, offset)) + } else { + args = append(args, fmt.Sprintf("--%s=%s", flags.FlagPageKey, next)) + } + args = append(args, fmt.Sprintf("--%s=%d", flags.FlagLimit, limit)) + if total { + args = append(args, fmt.Sprintf("--%s", flags.FlagCountTotal)) + } + return args + } + t.Run("ByOffset", func(t *testing.T) { + step := 2 + for i := 0; i < len(objs); i += step { + args := request(nil, uint64(i), uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListAllCertificatesBySubject(), args) + require.NoError(t, err) + var resp types.QueryAllAllCertificatesBySubjectResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.AllCertificatesBySubject), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.AllCertificatesBySubject), + ) + } + }) + t.Run("ByKey", func(t *testing.T) { + step := 2 + var next []byte + for i := 0; i < len(objs); i += step { + args := request(next, 0, uint64(step), false) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListAllCertificatesBySubject(), args) + require.NoError(t, err) + var resp types.QueryAllAllCertificatesBySubjectResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.LessOrEqual(t, len(resp.AllCertificatesBySubject), step) + require.Subset(t, + nullify.Fill(objs), + nullify.Fill(resp.AllCertificatesBySubject), + ) + next = resp.Pagination.NextKey + } + }) + t.Run("Total", func(t *testing.T) { + args := request(nil, 0, uint64(len(objs)), true) + out, err := clitestutil.ExecTestCLICmd(ctx, cli.CmdListAllCertificatesBySubject(), args) + require.NoError(t, err) + var resp types.QueryAllAllCertificatesBySubjectResponse + require.NoError(t, net.Config.Codec.UnmarshalJSON(out.Bytes(), &resp)) + require.NoError(t, err) + require.Equal(t, len(objs), int(resp.Pagination.Total)) + require.ElementsMatch(t, + nullify.Fill(objs), + nullify.Fill(resp.AllCertificatesBySubject), + ) + }) +}*/ diff --git a/x/pki/genesis.go b/x/pki/genesis.go index 71a607420..d96a8edb4 100644 --- a/x/pki/genesis.go +++ b/x/pki/genesis.go @@ -97,6 +97,10 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.RevokedNocIcaCertificatesList { k.SetRevokedNocIcaCertificates(ctx, elem) } + // Set all the allCertificatesBySubject + for _, elem := range genState.AllCertificatesBySubjectList { + k.SetAllCertificatesBySubject(ctx, elem) + } // this line is used by starport scaffolding # genesis/module/init } @@ -134,6 +138,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.NocCertificatesBySubjectKeyIDList = k.GetAllNocCertificatesBySubjectKeyID(ctx) genesis.CertificatesList = k.GetAllAllCertificates(ctx) genesis.RevokedNocIcaCertificatesList = k.GetAllRevokedNocIcaCertificates(ctx) + genesis.AllCertificatesBySubjectList = k.GetAllAllCertificatesBySubject(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/x/pki/genesis_test.go b/x/pki/genesis_test.go index 8ab5e8e93..b0b4cf4cd 100644 --- a/x/pki/genesis_test.go +++ b/x/pki/genesis_test.go @@ -216,6 +216,14 @@ func TestGenesis(t *testing.T) { SubjectKeyId: "1", }, }, + AllCertificatesBySubjectList: []types.AllCertificatesBySubject{ + { + Subject: "0", + }, + { + Subject: "1", + }, + }, // this line is used by starport scaffolding # genesis/test/state } @@ -246,5 +254,6 @@ func TestGenesis(t *testing.T) { require.ElementsMatch(t, genesisState.NocCertificatesBySubjectList, got.NocCertificatesBySubjectList) require.ElementsMatch(t, genesisState.CertificatesList, got.CertificatesList) require.ElementsMatch(t, genesisState.RevokedNocIcaCertificatesList, got.RevokedNocIcaCertificatesList) + require.ElementsMatch(t, genesisState.AllCertificatesBySubjectList, got.AllCertificatesBySubjectList) // this line is used by starport scaffolding # genesis/test/assert } diff --git a/x/pki/keeper/all_certificates_by_subject.go b/x/pki/keeper/all_certificates_by_subject.go new file mode 100644 index 000000000..6baa192ec --- /dev/null +++ b/x/pki/keeper/all_certificates_by_subject.go @@ -0,0 +1,129 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + pkitypes "github.com/zigbee-alliance/distributed-compliance-ledger/types/pki" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" +) + +// SetAllCertificatesBySubject set a specific allCertificatesBySubject in the store from its index +func (k Keeper) SetAllCertificatesBySubject(ctx sdk.Context, allCertificatesBySubject types.AllCertificatesBySubject) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), pkitypes.KeyPrefix(types.AllCertificatesBySubjectKeyPrefix)) + b := k.cdc.MustMarshal(&allCertificatesBySubject) + store.Set(types.AllCertificatesBySubjectKey( + allCertificatesBySubject.Subject, + ), b) +} + +// Add AllCertificates to a subject->subjectKeyId index. +func (k Keeper) AddAllCertificateBySubject(ctx sdk.Context, subject string, subjectKeyID string) { + AllCertificatesBySubject, _ := k.GetAllCertificatesBySubject(ctx, subject) + + // Check if cert is already there + for _, existingID := range AllCertificatesBySubject.SubjectKeyIds { + if existingID == subjectKeyID { + return + } + } + + AllCertificatesBySubject.Subject = subject + AllCertificatesBySubject.SubjectKeyIds = append(AllCertificatesBySubject.SubjectKeyIds, subjectKeyID) + + k.SetAllCertificatesBySubject(ctx, AllCertificatesBySubject) +} + +// AddAllCertificates add list of certificates in the store from its index +func (k Keeper) AddAllCertificatesBySubject(ctx sdk.Context, subject string, schemaVersion uint32, subjectKeyIds []string) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), pkitypes.KeyPrefix(types.AllCertificatesBySubjectKeyPrefix)) + + certificatesBytes := store.Get(types.AllCertificatesBySubjectKey( + subject, + )) + var certificates types.AllCertificatesBySubject + + if certificatesBytes == nil { + certificates = types.AllCertificatesBySubject{ + Subject: subject, + SubjectKeyIds: []string{}, + SchemaVersion: schemaVersion, + } + } else { + k.cdc.MustUnmarshal(certificatesBytes, &certificates) + } + + certificates.SubjectKeyIds = append(certificates.SubjectKeyIds, subjectKeyIds...) + + k.SetAllCertificatesBySubject(ctx, certificates) +} + +// GetAllCertificatesBySubject returns a allCertificatesBySubject from its index +func (k Keeper) GetAllCertificatesBySubject( + ctx sdk.Context, + subject string, + +) (val types.AllCertificatesBySubject, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), pkitypes.KeyPrefix(types.AllCertificatesBySubjectKeyPrefix)) + + b := store.Get(types.AllCertificatesBySubjectKey( + subject, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +// RemoveAllCertificateBySubject removes a allCertificatesBySubject from the store +func (k Keeper) RemoveAllCertificateBySubject(ctx sdk.Context, subject string, subjectKeyID string) { + AllCertificatesBySubject, _ := k.GetAllCertificatesBySubject(ctx, subject) + + certIDIndex := -1 + for i, existingIdentifier := range AllCertificatesBySubject.SubjectKeyIds { + if existingIdentifier == subjectKeyID { + certIDIndex = i + + break + } + } + if certIDIndex == -1 { + return + } + + AllCertificatesBySubject.SubjectKeyIds = append(AllCertificatesBySubject.SubjectKeyIds[:certIDIndex], AllCertificatesBySubject.SubjectKeyIds[certIDIndex+1:]...) + + if len(AllCertificatesBySubject.SubjectKeyIds) > 0 { + k.SetAllCertificatesBySubject(ctx, AllCertificatesBySubject) + } else { + k.RemoveAllCertificatesBySubject(ctx, subject) + } +} + +// RemoveAllCertificatesBySubject removes a AllCertificatesBySubject from the store. +func (k Keeper) RemoveAllCertificatesBySubject( + ctx sdk.Context, + subject string, +) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), pkitypes.KeyPrefix(types.AllCertificatesBySubjectKeyPrefix)) + store.Delete(types.AllCertificatesBySubjectKey( + subject, + )) +} + +// GetAllAllCertificatesBySubject returns all allCertificatesBySubject +func (k Keeper) GetAllAllCertificatesBySubject(ctx sdk.Context) (list []types.AllCertificatesBySubject) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), pkitypes.KeyPrefix(types.AllCertificatesBySubjectKeyPrefix)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.AllCertificatesBySubject + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/pki/keeper/all_certificates_by_subject_test.go b/x/pki/keeper/all_certificates_by_subject_test.go new file mode 100644 index 000000000..3e22f8b16 --- /dev/null +++ b/x/pki/keeper/all_certificates_by_subject_test.go @@ -0,0 +1,63 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + keepertest "github.com/zigbee-alliance/distributed-compliance-ledger/testutil/keeper" + "github.com/zigbee-alliance/distributed-compliance-ledger/testutil/nullify" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/keeper" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" +) + +// Prevent strconv unused error +var _ = strconv.IntSize + +func createNAllCertificatesBySubject(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.AllCertificatesBySubject { + items := make([]types.AllCertificatesBySubject, n) + for i := range items { + items[i].Subject = strconv.Itoa(i) + + keeper.SetAllCertificatesBySubject(ctx, items[i]) + } + return items +} + +func TestAllCertificatesBySubjectGet(t *testing.T) { + keeper, ctx := keepertest.PkiKeeper(t, nil) + items := createNAllCertificatesBySubject(keeper, ctx, 10) + for _, item := range items { + rst, found := keeper.GetAllCertificatesBySubject(ctx, + item.Subject, + ) + require.True(t, found) + require.Equal(t, + nullify.Fill(&item), + nullify.Fill(&rst), + ) + } +} +func TestAllCertificatesBySubjectRemove(t *testing.T) { + keeper, ctx := keepertest.PkiKeeper(t, nil) + items := createNAllCertificatesBySubject(keeper, ctx, 10) + for _, item := range items { + keeper.RemoveAllCertificatesBySubject(ctx, + item.Subject, + ) + _, found := keeper.GetAllCertificatesBySubject(ctx, + item.Subject, + ) + require.False(t, found) + } +} + +func TestAllCertificatesBySubjectGetAll(t *testing.T) { + keeper, ctx := keepertest.PkiKeeper(t, nil) + items := createNAllCertificatesBySubject(keeper, ctx, 10) + require.ElementsMatch(t, + nullify.Fill(items), + nullify.Fill(keeper.GetAllAllCertificatesBySubject(ctx)), + ) +} diff --git a/x/pki/keeper/child_certificates.go b/x/pki/keeper/child_certificates.go index ada5ff1ca..e8a438327 100644 --- a/x/pki/keeper/child_certificates.go +++ b/x/pki/keeper/child_certificates.go @@ -115,6 +115,9 @@ func (k msgServer) RevokeApprovedChildCertificates(ctx sdk.Context, issuer strin // Remove certificate from global certificates list k.RemoveAllCertificates(ctx, certIdentifier.Subject, certIdentifier.SubjectKeyId) + // remove from global subject -> subject key ID map + k.RemoveAllCertificateBySubject(ctx, certIdentifier.Subject, certIdentifier.SubjectKeyId) + // Remove certificate from approved certificates list k.RemoveApprovedCertificates(ctx, certIdentifier.Subject, certIdentifier.SubjectKeyId) @@ -150,6 +153,9 @@ func (k msgServer) RevokeNocChildCertificates(ctx sdk.Context, issuer string, au // Remove certificate from global certificates list k.RemoveAllCertificates(ctx, certIdentifier.Subject, certIdentifier.SubjectKeyId) + // remove from global subject -> subject key ID map + k.RemoveAllCertificateBySubject(ctx, certIdentifier.Subject, certIdentifier.SubjectKeyId) + // Remove certificate from noc certificates list k.RemoveNocCertificates(ctx, certIdentifier.Subject, certIdentifier.SubjectKeyId) diff --git a/x/pki/keeper/grpc_query_all_certificates_by_subject.go b/x/pki/keeper/grpc_query_all_certificates_by_subject.go new file mode 100644 index 000000000..9b1faacd8 --- /dev/null +++ b/x/pki/keeper/grpc_query_all_certificates_by_subject.go @@ -0,0 +1,27 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) AllCertificatesBySubject(c context.Context, req *types.QueryGetAllCertificatesBySubjectRequest) (*types.QueryGetAllCertificatesBySubjectResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + ctx := sdk.UnwrapSDKContext(c) + + val, found := k.GetAllCertificatesBySubject( + ctx, + req.Subject, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + + return &types.QueryGetAllCertificatesBySubjectResponse{AllCertificatesBySubject: val}, nil +} diff --git a/x/pki/keeper/grpc_query_all_certificates_by_subject_test.go b/x/pki/keeper/grpc_query_all_certificates_by_subject_test.go new file mode 100644 index 000000000..ee8c333d9 --- /dev/null +++ b/x/pki/keeper/grpc_query_all_certificates_by_subject_test.go @@ -0,0 +1,68 @@ +package keeper_test + +import ( + "strconv" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + keepertest "github.com/zigbee-alliance/distributed-compliance-ledger/testutil/keeper" + "github.com/zigbee-alliance/distributed-compliance-ledger/testutil/nullify" + "github.com/zigbee-alliance/distributed-compliance-ledger/x/pki/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +// Prevent strconv unused error. +var _ = strconv.IntSize + +func TestAllCertificatesBySubjectQuerySingle(t *testing.T) { + keeper, ctx := keepertest.PkiKeeper(t, nil) + wctx := sdk.WrapSDKContext(ctx) + msgs := createNAllCertificatesBySubject(keeper, ctx, 2) + for _, tc := range []struct { + desc string + request *types.QueryGetAllCertificatesBySubjectRequest + response *types.QueryGetAllCertificatesBySubjectResponse + err error + }{ + { + desc: "First", + request: &types.QueryGetAllCertificatesBySubjectRequest{ + Subject: msgs[0].Subject, + }, + response: &types.QueryGetAllCertificatesBySubjectResponse{AllCertificatesBySubject: msgs[0]}, + }, + { + desc: "Second", + request: &types.QueryGetAllCertificatesBySubjectRequest{ + Subject: msgs[1].Subject, + }, + response: &types.QueryGetAllCertificatesBySubjectResponse{AllCertificatesBySubject: msgs[1]}, + }, + { + desc: "KeyNotFound", + request: &types.QueryGetAllCertificatesBySubjectRequest{ + Subject: strconv.Itoa(100000), + }, + err: status.Error(codes.NotFound, "not found"), + }, + { + desc: "InvalidRequest", + err: status.Error(codes.InvalidArgument, "invalid request"), + }, + } { + t.Run(tc.desc, func(t *testing.T) { + response, err := keeper.AllCertificatesBySubject(wctx, tc.request) + if tc.err != nil { + require.ErrorIs(t, err, tc.err) + } else { + require.NoError(t, err) + require.Equal(t, + nullify.Fill(tc.response), + nullify.Fill(response), + ) + } + }) + } +} diff --git a/x/pki/keeper/keeper.go b/x/pki/keeper/keeper.go index 6bbf64bba..56060b0de 100644 --- a/x/pki/keeper/keeper.go +++ b/x/pki/keeper/keeper.go @@ -120,6 +120,7 @@ func filterCertificates(certificates *[]*types.Certificate, predicate Certificat func (k msgServer) removeApprovedX509Cert(ctx sdk.Context, certID types.CertificateIdentifier, certificates *types.ApprovedCertificates, serialNumber string) { if len(certificates.Certs) == 0 { k.RemoveAllCertificates(ctx, certID.Subject, certID.SubjectKeyId) + k.RemoveAllCertificateBySubject(ctx, certID.Subject, certID.SubjectKeyId) k.RemoveApprovedCertificates(ctx, certID.Subject, certID.SubjectKeyId) k.RemoveApprovedCertificateBySubject(ctx, certID.Subject, certID.SubjectKeyId) k.RemoveApprovedCertificatesBySubjectKeyID(ctx, certID.Subject, certID.SubjectKeyId) @@ -140,6 +141,7 @@ func (k msgServer) removeNocX509Cert( ) { if len(certificates.Certs) == 0 { //nolint:nestif k.RemoveAllCertificates(ctx, certID.Subject, certID.SubjectKeyId) + k.RemoveAllCertificateBySubject(ctx, certID.Subject, certID.SubjectKeyId) k.RemoveNocCertificates(ctx, certID.Subject, certID.SubjectKeyId) k.RemoveNocCertificateBySubject(ctx, certID.Subject, certID.SubjectKeyId) k.RemoveNocCertificatesBySubjectAndSubjectKeyID(ctx, certID.Subject, certID.SubjectKeyId) diff --git a/x/pki/keeper/migrations.go b/x/pki/keeper/migrations.go index 8d76545b4..4c3ddc1f6 100644 --- a/x/pki/keeper/migrations.go +++ b/x/pki/keeper/migrations.go @@ -33,19 +33,9 @@ func (m Migrator) Migrate3to4(ctx sdk.Context) error { for _, cert := range approvedCertificates { m.keeper.AddAllCertificates(ctx, cert.Subject, cert.SubjectKeyId, cert.SchemaVersion, cert.Certs) } - - return nil -} - -// Migrate2to4 migrates from version 2 to 4. -func (m Migrator) Migrate2to4(ctx sdk.Context) error { - err := m.Migrate2to3(ctx) - if err != nil { - return err - } - err = m.Migrate3to4(ctx) - if err != nil { - return err + approvedCertificatesBySubject := m.keeper.GetAllApprovedCertificatesBySubject(ctx) + for _, cert := range approvedCertificatesBySubject { + m.keeper.AddAllCertificatesBySubject(ctx, cert.Subject, cert.SchemaVersion, cert.SubjectKeyIds) } return nil diff --git a/x/pki/keeper/migrations_test.go b/x/pki/keeper/migrations_test.go index 3b9dce4f2..eb87541b4 100644 --- a/x/pki/keeper/migrations_test.go +++ b/x/pki/keeper/migrations_test.go @@ -27,6 +27,17 @@ func _createNApprovedCertificates(keeper *keeper.Keeper, ctx sdk.Context, n int) return items } +func _createNApprovedCertificatesBySubject(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.ApprovedCertificatesBySubject { + items := make([]types.ApprovedCertificatesBySubject, n) + for i := range items { + items[i].Subject = strconv.Itoa(i) + items[i].SubjectKeyIds = []string{strconv.Itoa(i)} + keeper.SetApprovedCertificatesBySubject(ctx, items[i]) + } + + return items +} + func TestMigrator_Migrate2to3(t *testing.T) { _keeper, ctx := keepertest.PkiKeeper(t, nil) msg := _createNApprovedCertificates(_keeper, ctx, 5) @@ -47,11 +58,13 @@ func TestMigrator_Migrate2to3(t *testing.T) { func TestMigrator_Migrate3to4(t *testing.T) { _keeper, ctx := keepertest.PkiKeeper(t, nil) msg := _createNApprovedCertificates(_keeper, ctx, 5) + _createNApprovedCertificatesBySubject(_keeper, ctx, 5) migrator := keeper.NewMigrator(*_keeper) err := migrator.Migrate3to4(ctx) require.NoError(t, err) + // check that all certificates migrated subject := "0" subjectKeyID := "0" list, found := _keeper.GetAllCertificates(ctx, subject, subjectKeyID) @@ -63,4 +76,10 @@ func TestMigrator_Migrate3to4(t *testing.T) { allList := _keeper.GetAllAllCertificates(ctx) require.Equal(t, 5, len(allList)) + + // check that all certificates by subject migrated + subjList, found := _keeper.GetAllCertificatesBySubject(ctx, subject) + require.True(t, found) + require.Equal(t, subject, subjList.Subject) + require.Equal(t, 1, len(subjList.SubjectKeyIds)) } diff --git a/x/pki/keeper/msg_server_add_noc_x_509_root_cert.go b/x/pki/keeper/msg_server_add_noc_x_509_root_cert.go index 6a54145de..20a356933 100644 --- a/x/pki/keeper/msg_server_add_noc_x_509_root_cert.go +++ b/x/pki/keeper/msg_server_add_noc_x_509_root_cert.go @@ -87,6 +87,9 @@ func (k msgServer) AddNocX509RootCert(goCtx context.Context, msg *types.MsgAddNo // Add to the global list of certificates k.AddAllCertificate(ctx, certificate) + // append to global list of certificates indexed by subject + k.AddAllCertificateBySubject(ctx, certificate.Subject, certificate.SubjectKeyId) + // Add to the list of all NOC certificates k.AddNocCertificate(ctx, certificate) diff --git a/x/pki/keeper/msg_server_add_x_509_cert.go b/x/pki/keeper/msg_server_add_x_509_cert.go index aa63d911d..eff3416ea 100644 --- a/x/pki/keeper/msg_server_add_x_509_cert.go +++ b/x/pki/keeper/msg_server_add_x_509_cert.go @@ -110,6 +110,9 @@ func (k msgServer) AddX509Cert(goCtx context.Context, msg *types.MsgAddX509Cert) // append to global list of certificates k.AddAllCertificate(ctx, certificate) + // append to global list of certificates indexed by subject + k.AddAllCertificateBySubject(ctx, certificate.Subject, certificate.SubjectKeyId) + // append new certificate to list of certificates with the same Subject/SubjectKeyID combination and store updated list k.AddApprovedCertificate(ctx, certificate) diff --git a/x/pki/keeper/msg_server_approve_add_x_509_root_cert.go b/x/pki/keeper/msg_server_approve_add_x_509_root_cert.go index 22c354422..8a198b0b6 100644 --- a/x/pki/keeper/msg_server_approve_add_x_509_root_cert.go +++ b/x/pki/keeper/msg_server_approve_add_x_509_root_cert.go @@ -82,6 +82,9 @@ func (k msgServer) ApproveAddX509RootCert(goCtx context.Context, msg *types.MsgA // add approved certificate to stored list of all certificates k.AddAllCertificate(ctx, rootCertificate) + // append to global list of certificates indexed by subject + k.AddAllCertificateBySubject(ctx, rootCertificate.Subject, rootCertificate.SubjectKeyId) + // add approved certificate to stored list of certificates with the same Subject/SubjectKeyID combination k.AddApprovedCertificate(ctx, rootCertificate) diff --git a/x/pki/keeper/msg_server_approve_revoke_x_509_root_cert.go b/x/pki/keeper/msg_server_approve_revoke_x_509_root_cert.go index f484c28ea..342ea1593 100644 --- a/x/pki/keeper/msg_server_approve_revoke_x_509_root_cert.go +++ b/x/pki/keeper/msg_server_approve_revoke_x_509_root_cert.go @@ -102,6 +102,7 @@ func (k msgServer) _revokeRootCertificates( k.RemoveApprovedRootCertificate(ctx, certID) k.RemoveAllCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) + k.RemoveAllCertificateBySubject(ctx, certificates.Subject, certificates.SubjectKeyId) k.RemoveApprovedCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) // remove from subject -> subject key ID map k.RemoveApprovedCertificateBySubject(ctx, certificates.Subject, certificates.SubjectKeyId) @@ -129,6 +130,7 @@ func (k msgServer) _revokeRootCertificate( if len(certificates.Certs) == 0 { k.RemoveAllCertificates(ctx, cert.Subject, cert.SubjectKeyId) + k.RemoveAllCertificateBySubject(ctx, cert.Subject, cert.SubjectKeyId) k.RemoveApprovedCertificates(ctx, cert.Subject, cert.SubjectKeyId) k.RemoveApprovedRootCertificate(ctx, types.CertificateIdentifier{ diff --git a/x/pki/keeper/msg_server_remove_noc_x_509_ica_cert.go b/x/pki/keeper/msg_server_remove_noc_x_509_ica_cert.go index 8bbcc26c5..0d8a94ce0 100644 --- a/x/pki/keeper/msg_server_remove_noc_x_509_ica_cert.go +++ b/x/pki/keeper/msg_server_remove_noc_x_509_ica_cert.go @@ -81,6 +81,8 @@ func (k msgServer) RemoveNocX509IcaCert(goCtx context.Context, msg *types.MsgRem } else { // remove from global certificates map k.RemoveAllCertificates(ctx, certID.Subject, certID.SubjectKeyId) + // remove from global subject -> subject key ID map + k.RemoveAllCertificateBySubject(ctx, certID.Subject, certID.SubjectKeyId) // remove from noc certificates map k.RemoveNocCertificates(ctx, certID.Subject, certID.SubjectKeyId) // remove from noc ica certificates map diff --git a/x/pki/keeper/msg_server_remove_noc_x_509_root_cert.go b/x/pki/keeper/msg_server_remove_noc_x_509_root_cert.go index 80ac63bd8..791af0a64 100644 --- a/x/pki/keeper/msg_server_remove_noc_x_509_root_cert.go +++ b/x/pki/keeper/msg_server_remove_noc_x_509_root_cert.go @@ -77,6 +77,8 @@ func (k msgServer) RemoveNocX509RootCert(goCtx context.Context, msg *types.MsgRe } else { // remove from global certificates map k.RemoveAllCertificates(ctx, certID.Subject, certID.SubjectKeyId) + // remove from global subject -> subject key ID map + k.RemoveAllCertificateBySubject(ctx, certID.Subject, certID.SubjectKeyId) // remove from noc certificates map k.RemoveNocCertificates(ctx, certID.Subject, certID.SubjectKeyId) // remove from noc root certificates map diff --git a/x/pki/keeper/msg_server_remove_x_509_cert.go b/x/pki/keeper/msg_server_remove_x_509_cert.go index 749c04175..6570b3ba1 100644 --- a/x/pki/keeper/msg_server_remove_x_509_cert.go +++ b/x/pki/keeper/msg_server_remove_x_509_cert.go @@ -69,6 +69,8 @@ func (k msgServer) RemoveX509Cert(goCtx context.Context, msg *types.MsgRemoveX50 } else { // remove from global certificates map k.RemoveAllCertificates(ctx, certID.Subject, certID.SubjectKeyId) + // remove from global subject -> subject key ID map + k.RemoveAllCertificateBySubject(ctx, certID.Subject, certID.SubjectKeyId) // remove from approved certificates map k.RemoveApprovedCertificates(ctx, certID.Subject, certID.SubjectKeyId) // remove from subject -> subject key ID map diff --git a/x/pki/keeper/msg_server_revoke_noc_x_509_ica_cert.go b/x/pki/keeper/msg_server_revoke_noc_x_509_ica_cert.go index e73a669bc..a307e0a50 100644 --- a/x/pki/keeper/msg_server_revoke_noc_x_509_ica_cert.go +++ b/x/pki/keeper/msg_server_revoke_noc_x_509_ica_cert.go @@ -84,6 +84,7 @@ func (k msgServer) _revokeNocCertificate( if len(certificates.Certs) == 0 { k.RemoveAllCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) + k.RemoveAllCertificateBySubject(ctx, certificates.Subject, certificates.SubjectKeyId) k.RemoveNocCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) k.RemoveNocIcaCertificate(ctx, certificates.Subject, certificates.SubjectKeyId, vid) k.RemoveNocCertificatesByVidAndSkid(ctx, vid, cert.SubjectKeyId) @@ -109,6 +110,8 @@ func (k msgServer) _revokeNocIcaCertificates(ctx sdk.Context, certificates types }) // remove cert from global certs list k.RemoveAllCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) + // remove cert from global certs list -> subject key ID map + k.RemoveAllCertificateBySubject(ctx, certificates.Subject, certificates.SubjectKeyId) // remove cert from NOC certs list k.RemoveNocCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) // remove cert from NOC ica certs list diff --git a/x/pki/keeper/msg_server_revoke_noc_x_509_root_cert.go b/x/pki/keeper/msg_server_revoke_noc_x_509_root_cert.go index 84c00156e..2aac42556 100644 --- a/x/pki/keeper/msg_server_revoke_noc_x_509_root_cert.go +++ b/x/pki/keeper/msg_server_revoke_noc_x_509_root_cert.go @@ -89,6 +89,7 @@ func (k msgServer) _revokeNocRootCertificate( if len(certificates.Certs) == 0 { k.RemoveAllCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) + k.RemoveAllCertificateBySubject(ctx, certificates.Subject, certificates.SubjectKeyId) k.RemoveNocCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) k.RemoveNocRootCertificate(ctx, certificates.Subject, certificates.SubjectKeyId, vid) k.RemoveNocCertificatesByVidAndSkid(ctx, vid, cert.SubjectKeyId) @@ -115,6 +116,8 @@ func (k msgServer) _revokeNocRootCertificates(ctx sdk.Context, certificates type // remove cert from global certs list k.RemoveAllCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) + // remove cert from global certs list -> subject key ID map + k.RemoveAllCertificateBySubject(ctx, certificates.Subject, certificates.SubjectKeyId) // remove cert from NOC certs list k.RemoveNocCertificates(ctx, certificates.Subject, certificates.SubjectKeyId) // remove cert from NOC ica certs list diff --git a/x/pki/keeper/msg_server_revoke_x_509_cert.go b/x/pki/keeper/msg_server_revoke_x_509_cert.go index cf3f9b270..0aa933891 100644 --- a/x/pki/keeper/msg_server_revoke_x_509_cert.go +++ b/x/pki/keeper/msg_server_revoke_x_509_cert.go @@ -65,6 +65,8 @@ func (k msgServer) _revokeX509Certificates(ctx sdk.Context, certID types.Certifi // Remove certificate from global list k.RemoveAllCertificates(ctx, certID.Subject, certID.SubjectKeyId) + // Remove certificate from global list -> subject key ID map + k.RemoveAllCertificateBySubject(ctx, certID.Subject, certID.SubjectKeyId) // Remove certificate from approved list k.RemoveApprovedCertificates(ctx, certID.Subject, certID.SubjectKeyId) // Remove certificate identifier from issuer's ChildCertificates record @@ -87,6 +89,7 @@ func (k msgServer) _revokeX509Certificate(ctx sdk.Context, cert *types.Certifica removeCertFromList(cert.Issuer, cert.SerialNumber, &certificates.Certs) if len(certificates.Certs) == 0 { k.RemoveAllCertificates(ctx, cert.Subject, cert.SubjectKeyId) + k.RemoveAllCertificateBySubject(ctx, cert.Subject, cert.SubjectKeyId) k.RemoveApprovedCertificates(ctx, cert.Subject, cert.SubjectKeyId) k.RemoveApprovedCertificateBySubject(ctx, cert.Subject, cert.SubjectKeyId) k.RemoveApprovedCertificatesBySubjectKeyID(ctx, cert.Subject, cert.SubjectKeyId) diff --git a/x/pki/module.go b/x/pki/module.go index e6fb1ebae..996594468 100644 --- a/x/pki/module.go +++ b/x/pki/module.go @@ -122,7 +122,6 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { m := keeper.NewMigrator(am.keeper) _ = cfg.RegisterMigration(pkitypes.ModuleName, 1, m.Migrate1to2) _ = cfg.RegisterMigration(pkitypes.ModuleName, 2, m.Migrate2to3) - _ = cfg.RegisterMigration(pkitypes.ModuleName, 2, m.Migrate2to4) _ = cfg.RegisterMigration(pkitypes.ModuleName, 3, m.Migrate3to4) } diff --git a/x/pki/types/all_certificates_by_subject.pb.go b/x/pki/types/all_certificates_by_subject.pb.go new file mode 100644 index 000000000..8100adec3 --- /dev/null +++ b/x/pki/types/all_certificates_by_subject.pb.go @@ -0,0 +1,412 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.proto + +package types + +import ( + fmt "fmt" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type AllCertificatesBySubject struct { + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` + SubjectKeyIds []string `protobuf:"bytes,2,rep,name=subjectKeyIds,proto3" json:"subjectKeyIds,omitempty"` + SchemaVersion uint32 `protobuf:"varint,3,opt,name=schemaVersion,proto3" json:"schemaVersion,omitempty"` +} + +func (m *AllCertificatesBySubject) Reset() { *m = AllCertificatesBySubject{} } +func (m *AllCertificatesBySubject) String() string { return proto.CompactTextString(m) } +func (*AllCertificatesBySubject) ProtoMessage() {} +func (*AllCertificatesBySubject) Descriptor() ([]byte, []int) { + return fileDescriptor_35ed20fcb7a53f2f, []int{0} +} +func (m *AllCertificatesBySubject) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AllCertificatesBySubject) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AllCertificatesBySubject.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *AllCertificatesBySubject) XXX_Merge(src proto.Message) { + xxx_messageInfo_AllCertificatesBySubject.Merge(m, src) +} +func (m *AllCertificatesBySubject) XXX_Size() int { + return m.Size() +} +func (m *AllCertificatesBySubject) XXX_DiscardUnknown() { + xxx_messageInfo_AllCertificatesBySubject.DiscardUnknown(m) +} + +var xxx_messageInfo_AllCertificatesBySubject proto.InternalMessageInfo + +func (m *AllCertificatesBySubject) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +func (m *AllCertificatesBySubject) GetSubjectKeyIds() []string { + if m != nil { + return m.SubjectKeyIds + } + return nil +} + +func (m *AllCertificatesBySubject) GetSchemaVersion() uint32 { + if m != nil { + return m.SchemaVersion + } + return 0 +} + +func init() { + proto.RegisterType((*AllCertificatesBySubject)(nil), "zigbeealliance.distributedcomplianceledger.pki.AllCertificatesBySubject") +} + +func init() { + proto.RegisterFile("zigbeealliance/distributedcomplianceledger/pki/all_certificates_by_subject.proto", fileDescriptor_35ed20fcb7a53f2f) +} + +var fileDescriptor_35ed20fcb7a53f2f = []byte{ + // 255 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x0a, 0xa8, 0xca, 0x4c, 0x4f, + 0x4a, 0x4d, 0x4d, 0xcc, 0xc9, 0xc9, 0x4c, 0xcc, 0x4b, 0x4e, 0xd5, 0x4f, 0xc9, 0x2c, 0x2e, 0x29, + 0xca, 0x4c, 0x2a, 0x2d, 0x49, 0x4d, 0x49, 0xce, 0xcf, 0x2d, 0x80, 0x88, 0xe6, 0xa4, 0xa6, 0xa4, + 0xa7, 0x16, 0xe9, 0x17, 0x64, 0x67, 0xea, 0x27, 0xe6, 0xe4, 0xc4, 0x27, 0xa7, 0x16, 0x95, 0x64, + 0xa6, 0x65, 0x26, 0x27, 0x96, 0xa4, 0x16, 0xc7, 0x27, 0x55, 0xc6, 0x17, 0x97, 0x26, 0x65, 0xa5, + 0x26, 0x97, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xe9, 0xa1, 0x9a, 0xa8, 0x87, 0xc7, 0x44, + 0xbd, 0x82, 0xec, 0x4c, 0xa5, 0x06, 0x46, 0x2e, 0x09, 0xc7, 0x9c, 0x1c, 0x67, 0x24, 0x43, 0x9d, + 0x2a, 0x83, 0x21, 0x46, 0x0a, 0x49, 0x70, 0xb1, 0x43, 0x4d, 0x97, 0x60, 0x54, 0x60, 0xd4, 0xe0, + 0x0c, 0x82, 0x71, 0x85, 0x54, 0xb8, 0x78, 0xa1, 0x4c, 0xef, 0xd4, 0x4a, 0xcf, 0x94, 0x62, 0x09, + 0x26, 0x05, 0x66, 0x0d, 0xce, 0x20, 0x54, 0x41, 0xb0, 0xaa, 0xe4, 0x8c, 0xd4, 0xdc, 0xc4, 0xb0, + 0xd4, 0xa2, 0xe2, 0xcc, 0xfc, 0x3c, 0x09, 0x66, 0x05, 0x46, 0x0d, 0xde, 0x20, 0x54, 0x41, 0xa7, + 0xb8, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, + 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x72, 0x49, 0xcf, 0x2c, 0xc9, + 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87, 0xf8, 0x4b, 0x17, 0x5b, 0x50, 0xe9, 0x22, 0x7c, + 0xa6, 0x0b, 0x0d, 0xac, 0x0a, 0x70, 0x70, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x43, + 0xc6, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x08, 0x2a, 0x95, 0x83, 0x6d, 0x01, 0x00, 0x00, +} + +func (m *AllCertificatesBySubject) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *AllCertificatesBySubject) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AllCertificatesBySubject) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.SchemaVersion != 0 { + i = encodeVarintAllCertificatesBySubject(dAtA, i, uint64(m.SchemaVersion)) + i-- + dAtA[i] = 0x18 + } + if len(m.SubjectKeyIds) > 0 { + for iNdEx := len(m.SubjectKeyIds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubjectKeyIds[iNdEx]) + copy(dAtA[i:], m.SubjectKeyIds[iNdEx]) + i = encodeVarintAllCertificatesBySubject(dAtA, i, uint64(len(m.SubjectKeyIds[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintAllCertificatesBySubject(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintAllCertificatesBySubject(dAtA []byte, offset int, v uint64) int { + offset -= sovAllCertificatesBySubject(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *AllCertificatesBySubject) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovAllCertificatesBySubject(uint64(l)) + } + if len(m.SubjectKeyIds) > 0 { + for _, s := range m.SubjectKeyIds { + l = len(s) + n += 1 + l + sovAllCertificatesBySubject(uint64(l)) + } + } + if m.SchemaVersion != 0 { + n += 1 + sovAllCertificatesBySubject(uint64(m.SchemaVersion)) + } + return n +} + +func sovAllCertificatesBySubject(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozAllCertificatesBySubject(x uint64) (n int) { + return sovAllCertificatesBySubject(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *AllCertificatesBySubject) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAllCertificatesBySubject + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: AllCertificatesBySubject: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AllCertificatesBySubject: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAllCertificatesBySubject + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAllCertificatesBySubject + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAllCertificatesBySubject + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SubjectKeyIds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAllCertificatesBySubject + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthAllCertificatesBySubject + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthAllCertificatesBySubject + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SubjectKeyIds = append(m.SubjectKeyIds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SchemaVersion", wireType) + } + m.SchemaVersion = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAllCertificatesBySubject + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.SchemaVersion |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipAllCertificatesBySubject(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAllCertificatesBySubject + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipAllCertificatesBySubject(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAllCertificatesBySubject + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAllCertificatesBySubject + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowAllCertificatesBySubject + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthAllCertificatesBySubject + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupAllCertificatesBySubject + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthAllCertificatesBySubject + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthAllCertificatesBySubject = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowAllCertificatesBySubject = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupAllCertificatesBySubject = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/pki/types/genesis.go b/x/pki/types/genesis.go index d3e396a11..40591b83a 100644 --- a/x/pki/types/genesis.go +++ b/x/pki/types/genesis.go @@ -32,6 +32,7 @@ func DefaultGenesis() *GenesisState { NocCertificatesBySubjectList: []NocCertificatesBySubject{}, CertificatesList: []AllCertificates{}, RevokedNocIcaCertificatesList: []RevokedNocIcaCertificates{}, + AllCertificatesBySubjectList: []AllCertificatesBySubject{}, // this line is used by starport scaffolding # genesis/types/default } } @@ -232,6 +233,16 @@ func (gs GenesisState) Validate() error { //nolint:gocyclo,vet } revokedNocIcaCertificatesIndexMap[index] = struct{}{} } + // Check for duplicated index in allCertificatesBySubject + allCertificatesBySubjectIndexMap := make(map[string]struct{}) + + for _, elem := range gs.AllCertificatesBySubjectList { + index := string(AllCertificatesBySubjectKey(elem.Subject)) + if _, ok := allCertificatesBySubjectIndexMap[index]; ok { + return fmt.Errorf("duplicated index for allCertificatesBySubject") + } + allCertificatesBySubjectIndexMap[index] = struct{}{} + } // this line is used by starport scaffolding # genesis/types/validate return nil diff --git a/x/pki/types/genesis.pb.go b/x/pki/types/genesis.pb.go index 51456bdd5..142c19ee3 100644 --- a/x/pki/types/genesis.pb.go +++ b/x/pki/types/genesis.pb.go @@ -47,6 +47,7 @@ type GenesisState struct { NocCertificatesBySubjectList []NocCertificatesBySubject `protobuf:"bytes,20,rep,name=nocCertificatesBySubjectList,proto3" json:"nocCertificatesBySubjectList"` CertificatesList []AllCertificates `protobuf:"bytes,21,rep,name=certificatesList,proto3" json:"certificatesList"` RevokedNocIcaCertificatesList []RevokedNocIcaCertificates `protobuf:"bytes,22,rep,name=revokedNocIcaCertificatesList,proto3" json:"revokedNocIcaCertificatesList"` + AllCertificatesBySubjectList []AllCertificatesBySubject `protobuf:"bytes,23,rep,name=allCertificatesBySubjectList,proto3" json:"allCertificatesBySubjectList"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -236,6 +237,13 @@ func (m *GenesisState) GetRevokedNocIcaCertificatesList() []RevokedNocIcaCertifi return nil } +func (m *GenesisState) GetAllCertificatesBySubjectList() []AllCertificatesBySubject { + if m != nil { + return m.AllCertificatesBySubjectList + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "zigbeealliance.distributedcomplianceledger.pki.GenesisState") } @@ -245,66 +253,67 @@ func init() { } var fileDescriptor_f53eb28747bee8a8 = []byte{ - // 933 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0xc7, 0x33, 0xec, 0xb2, 0xc0, 0x74, 0x81, 0x65, 0x76, 0x5b, 0x4a, 0x05, 0x69, 0xe9, 0x01, - 0xf5, 0xd2, 0x44, 0x2a, 0x07, 0x2e, 0x48, 0x28, 0x69, 0x50, 0x9b, 0x16, 0x42, 0x48, 0x69, 0x91, - 0x10, 0xc2, 0x72, 0xc6, 0x43, 0x3a, 0xd8, 0xf5, 0xb8, 0xb6, 0x53, 0x08, 0x12, 0x12, 0x08, 0xc4, - 0x19, 0x21, 0x21, 0x21, 0x71, 0x42, 0xe2, 0x03, 0x70, 0xe5, 0x1b, 0xf4, 0xd8, 0x23, 0x27, 0x84, - 0x9a, 0x2f, 0xb2, 0xca, 0xf3, 0xb8, 0x49, 0xec, 0xb1, 0x53, 0x4f, 0x7d, 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xb2, 0xc6, - 0x87, 0x6c, 0xd4, 0x6e, 0x01, 0xfb, 0x43, 0x60, 0xa7, 0xe5, 0xb2, 0x2b, 0xed, 0xe4, 0x82, 0x74, - 0x49, 0xc9, 0xdf, 0x08, 0xbf, 0x95, 0x1b, 0x9c, 0xc9, 0xad, 0x16, 0x2c, 0xea, 0x45, 0x58, 0x54, - 0xaf, 0xd4, 0xec, 0x82, 0xba, 0x5c, 0xc3, 0x2d, 0x39, 0x20, 0xc5, 0xae, 0xa0, 0xc9, 0x09, 0x04, - 0xc6, 0x97, 0xf4, 0x52, 0xdc, 0x49, 0xcb, 0xc5, 0x29, 0xce, 0x70, 0x22, 0xdf, 0x23, 0xbc, 0xe2, - 0x0a, 0xda, 0xa6, 0x66, 0x0a, 0xe2, 0x65, 0x80, 0x68, 0x6a, 0x40, 0x24, 0xd4, 0x24, 0x43, 0x86, - 0x0f, 0xf9, 0x1d, 0xe1, 0xaa, 0xdc, 0x8e, 0x3a, 0x19, 0xf5, 0x78, 0x04, 0x28, 0x07, 0x9a, 0xbb, - 0x5f, 0x76, 0x59, 0x16, 0xf8, 0x92, 0x3f, 0x10, 0x5e, 0x77, 0x05, 0x9d, 0xef, 0xe4, 0x09, 0xb7, - 0x1a, 0xae, 0x75, 0x64, 0xf3, 0x28, 0x4f, 0xaf, 0x00, 0xdb, 0xa1, 0x46, 0x99, 0xb2, 0x64, 0x25, - 0xdc, 0x22, 0x67, 0xd8, 0xab, 0x53, 0x32, 0xa9, 0x21, 0x26, 0x7a, 0x7b, 0x75, 0xae, 0x70, 0xbc, - 0x57, 0x2f, 0x74, 0x27, 0x5f, 0xe3, 0xc7, 0x89, 0x65, 0x00, 0xd4, 0x63, 0x80, 0x7a, 0xef, 0xae, - 0x50, 0x11, 0x86, 0xca, 0x81, 0xfc, 0x8a, 0xf0, 0xeb, 0x6e, 0x06, 0x1e, 0x20, 0x3c, 0x01, 0x84, - 0xfd, 0xb2, 0xea, 0x22, 0x59, 0x72, 0x3d, 0xc9, 0x39, 0x7e, 0x44, 0x93, 0xa5, 0x58, 0xd6, 0x2b, - 0x45, 0xc3, 0x71, 0x14, 0xa5, 0x48, 0xc9, 0x93, 0xdf, 0x10, 0x7e, 0x63, 0x9a, 0x72, 0xd5, 0x9c, - 0xaf, 0x00, 0x40, 0x5b, 0x7f, 0xb8, 0xd4, 0xe3, 0x9e, 0xef, 0xda, 0xfc, 0xe2, 0xf2, 0xba, 0x8a, - 0xae, 0xae, 0xab, 0xe8, 0xff, 0xeb, 0x2a, 0xfa, 0x65, 0x5c, 0xad, 0x5c, 0x8d, 0xab, 0x95, 0x7f, - 0xc7, 0xd5, 0xca, 0x67, 0xad, 0x01, 0x0f, 0x4f, 0x87, 0xfd, 0x1a, 0x15, 0x67, 0xf5, 0x88, 0x69, - 0x5b, 0xf5, 0xf9, 0xb4, 0x3d, 0xa5, 0xda, 0x96, 0x1f, 0x50, 0xdf, 0xc0, 0x27, 0x54, 0x38, 0xf2, - 0x58, 0xd0, 0x7f, 0x00, 0x9f, 0x48, 0x6f, 0x3f, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xd1, 0x3d, - 0x34, 0xab, 0x14, 0x00, 0x00, + // 956 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0x4f, 0x6f, 0xe3, 0x44, + 0x18, 0xc6, 0x33, 0xec, 0xb2, 0xc0, 0x74, 0x81, 0x65, 0xf6, 0x5f, 0x55, 0x41, 0x76, 0xd9, 0x03, + 0xda, 0x4b, 0x13, 0x69, 0x39, 0x70, 0x41, 0x42, 0x49, 0x83, 0xba, 0xd9, 0x85, 0x10, 0x52, 0x5a, + 0x24, 0x84, 0xb0, 0x9c, 0xf1, 0x90, 0x0e, 0x76, 0x3d, 0xae, 0xed, 0x14, 0x82, 0x84, 0x04, 0x02, + 0x71, 0x46, 0x48, 0x48, 0x48, 0x9c, 0x90, 0xf8, 0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 0x06, 0x40, + 0xdd, 0x04, 0xa8, 0xf7, 0xd6, 0x85, 0x4a, 0x30, 0x54, 0x0e, 0xe4, 0x57, 0x84, 0x5f, 0xf7, 0x35, + 0x78, 0x80, 0x70, 0x0b, 0x10, 0x1e, 0x57, 0xd5, 0x17, 0xc9, 0x52, 0xe8, 0x49, 0x8e, 0xf1, 0x0d, + 0x9a, 0x6d, 0xc5, 0x6d, 0xb3, 0x56, 0xb4, 0x3c, 0x4f, 0xd1, 0x8a, 0x9c, 0x3c, 0xf9, 0x0d, 0xe1, + 0x37, 0xe6, 0x29, 0x57, 0xed, 0xf9, 0x1d, 0x00, 0xe8, 0x9a, 0x2f, 0x97, 0x7a, 0xdd, 0x8b, 0x5d, + 0x61, 0x3e, 0x76, 0xa6, 0x86, 0xa5, 0xf9, 0xdc, 0x35, 0x9b, 0x4f, 0x4b, 0xa3, 0x99, 0xce, 0xa7, + 0xc8, 0xb3, 0xfd, 0xc5, 0xe9, 0x79, 0x1d, 0x9d, 0x9d, 0xd7, 0xd1, 0xff, 0xe7, 0x75, 0xf4, 0xcb, + 0xb4, 0x5e, 0x3b, 0x9b, 0xd6, 0x6b, 0xff, 0x4e, 0xeb, 0xb5, 0xcf, 0x3a, 0x23, 0x1e, 0x1f, 0x8e, + 0x87, 0x0d, 0x2a, 0x8e, 0x9a, 0x09, 0xd1, 0xb6, 0xea, 0xf5, 0x6e, 0x7b, 0xce, 0xb4, 0x2d, 0x5f, + 0xf0, 0xbe, 0x81, 0x57, 0xbc, 0x78, 0x12, 0xb0, 0x68, 0x78, 0x0d, 0xde, 0xdb, 0xde, 0x7e, 0x16, + 0x00, 0x00, 0xff, 0xff, 0x96, 0xaf, 0x2b, 0x83, 0x92, 0x15, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -327,6 +336,22 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AllCertificatesBySubjectList) > 0 { + for iNdEx := len(m.AllCertificatesBySubjectList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllCertificatesBySubjectList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xba + } + } if len(m.RevokedNocIcaCertificatesList) > 0 { for iNdEx := len(m.RevokedNocIcaCertificatesList) - 1; iNdEx >= 0; iNdEx-- { { @@ -793,6 +818,12 @@ func (m *GenesisState) Size() (n int) { n += 2 + l + sovGenesis(uint64(l)) } } + if len(m.AllCertificatesBySubjectList) > 0 { + for _, e := range m.AllCertificatesBySubjectList { + l = e.Size() + n += 2 + l + sovGenesis(uint64(l)) + } + } return n } @@ -1583,6 +1614,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 23: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllCertificatesBySubjectList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllCertificatesBySubjectList = append(m.AllCertificatesBySubjectList, AllCertificatesBySubject{}) + if err := m.AllCertificatesBySubjectList[len(m.AllCertificatesBySubjectList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/pki/types/genesis_test.go b/x/pki/types/genesis_test.go index 19b9f7019..14804de12 100644 --- a/x/pki/types/genesis_test.go +++ b/x/pki/types/genesis_test.go @@ -210,6 +210,14 @@ SubjectKeyID: "0", SubjectKeyID: "1", }, }, +AllCertificatesBySubjectList: []types.AllCertificatesBySubject{ + { + Subject: "0", +}, + { + Subject: "1", +}, +}, // this line is used by starport scaffolding # types/genesis/validField }, valid: true, @@ -510,6 +518,20 @@ SubjectKeyID: "0", }, valid: false, }, +{ + desc: "duplicated allCertificatesBySubject", + genState: &types.GenesisState{ + AllCertificatesBySubjectList: []types.AllCertificatesBySubject{ + { + Subject: "0", +}, + { + Subject: "0", +}, + }, + }, + valid: false, +}, // this line is used by starport scaffolding # types/genesis/testcase } { t.Run(tc.desc, func(t *testing.T) { diff --git a/x/pki/types/key_all_certificates_by_subject.go b/x/pki/types/key_all_certificates_by_subject.go new file mode 100644 index 000000000..9fc4b8bef --- /dev/null +++ b/x/pki/types/key_all_certificates_by_subject.go @@ -0,0 +1,23 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // AllCertificatesBySubjectKeyPrefix is the prefix to retrieve all AllCertificatesBySubject + AllCertificatesBySubjectKeyPrefix = "AllCertificatesBySubject/value/" +) + +// AllCertificatesBySubjectKey returns the store key to retrieve a AllCertificatesBySubject from the index fields +func AllCertificatesBySubjectKey( + subject string, +) []byte { + var key []byte + + subjectBytes := []byte(subject) + key = append(key, subjectBytes...) + key = append(key, []byte("/")...) + + return key +} diff --git a/x/pki/types/query.pb.go b/x/pki/types/query.pb.go index 27159873e..3f95a9cf2 100644 --- a/x/pki/types/query.pb.go +++ b/x/pki/types/query.pb.go @@ -127,6 +127,98 @@ func (m *QueryAllCertificatesResponse) GetPagination() *query.PageResponse { return nil } +type QueryGetAllCertificatesBySubjectRequest struct { + Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` +} + +func (m *QueryGetAllCertificatesBySubjectRequest) Reset() { + *m = QueryGetAllCertificatesBySubjectRequest{} +} +func (m *QueryGetAllCertificatesBySubjectRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetAllCertificatesBySubjectRequest) ProtoMessage() {} +func (*QueryGetAllCertificatesBySubjectRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_db6ffa8ae459ba1c, []int{2} +} +func (m *QueryGetAllCertificatesBySubjectRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetAllCertificatesBySubjectRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetAllCertificatesBySubjectRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetAllCertificatesBySubjectRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAllCertificatesBySubjectRequest.Merge(m, src) +} +func (m *QueryGetAllCertificatesBySubjectRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetAllCertificatesBySubjectRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAllCertificatesBySubjectRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetAllCertificatesBySubjectRequest proto.InternalMessageInfo + +func (m *QueryGetAllCertificatesBySubjectRequest) GetSubject() string { + if m != nil { + return m.Subject + } + return "" +} + +type QueryGetAllCertificatesBySubjectResponse struct { + AllCertificatesBySubject AllCertificatesBySubject `protobuf:"bytes,1,opt,name=allCertificatesBySubject,proto3" json:"allCertificatesBySubject"` +} + +func (m *QueryGetAllCertificatesBySubjectResponse) Reset() { + *m = QueryGetAllCertificatesBySubjectResponse{} +} +func (m *QueryGetAllCertificatesBySubjectResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetAllCertificatesBySubjectResponse) ProtoMessage() {} +func (*QueryGetAllCertificatesBySubjectResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_db6ffa8ae459ba1c, []int{3} +} +func (m *QueryGetAllCertificatesBySubjectResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetAllCertificatesBySubjectResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetAllCertificatesBySubjectResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryGetAllCertificatesBySubjectResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAllCertificatesBySubjectResponse.Merge(m, src) +} +func (m *QueryGetAllCertificatesBySubjectResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetAllCertificatesBySubjectResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAllCertificatesBySubjectResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetAllCertificatesBySubjectResponse proto.InternalMessageInfo + +func (m *QueryGetAllCertificatesBySubjectResponse) GetAllCertificatesBySubject() AllCertificatesBySubject { + if m != nil { + return m.AllCertificatesBySubject + } + return AllCertificatesBySubject{} +} + type QueryGetCertificatesRequest struct { Subject string `protobuf:"bytes,1,opt,name=subject,proto3" json:"subject,omitempty"` SubjectKeyId string `protobuf:"bytes,2,opt,name=subjectKeyId,proto3" json:"subjectKeyId,omitempty"` @@ -136,7 +228,7 @@ func (m *QueryGetCertificatesRequest) Reset() { *m = QueryGetCertificate func (m *QueryGetCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetCertificatesRequest) ProtoMessage() {} func (*QueryGetCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{2} + return fileDescriptor_db6ffa8ae459ba1c, []int{4} } func (m *QueryGetCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -187,7 +279,7 @@ func (m *QueryGetCertificatesResponse) Reset() { *m = QueryGetCertificat func (m *QueryGetCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetCertificatesResponse) ProtoMessage() {} func (*QueryGetCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{3} + return fileDescriptor_db6ffa8ae459ba1c, []int{5} } func (m *QueryGetCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -232,7 +324,7 @@ func (m *QueryGetApprovedCertificatesRequest) Reset() { *m = QueryGetApp func (m *QueryGetApprovedCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetApprovedCertificatesRequest) ProtoMessage() {} func (*QueryGetApprovedCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{4} + return fileDescriptor_db6ffa8ae459ba1c, []int{6} } func (m *QueryGetApprovedCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -283,7 +375,7 @@ func (m *QueryGetApprovedCertificatesResponse) Reset() { *m = QueryGetAp func (m *QueryGetApprovedCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetApprovedCertificatesResponse) ProtoMessage() {} func (*QueryGetApprovedCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{5} + return fileDescriptor_db6ffa8ae459ba1c, []int{7} } func (m *QueryGetApprovedCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -328,7 +420,7 @@ func (m *QueryAllApprovedCertificatesRequest) Reset() { *m = QueryAllApp func (m *QueryAllApprovedCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllApprovedCertificatesRequest) ProtoMessage() {} func (*QueryAllApprovedCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{6} + return fileDescriptor_db6ffa8ae459ba1c, []int{8} } func (m *QueryAllApprovedCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -380,7 +472,7 @@ func (m *QueryAllApprovedCertificatesResponse) Reset() { *m = QueryAllAp func (m *QueryAllApprovedCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllApprovedCertificatesResponse) ProtoMessage() {} func (*QueryAllApprovedCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{7} + return fileDescriptor_db6ffa8ae459ba1c, []int{9} } func (m *QueryAllApprovedCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -432,7 +524,7 @@ func (m *QueryGetProposedCertificateRequest) Reset() { *m = QueryGetProp func (m *QueryGetProposedCertificateRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetProposedCertificateRequest) ProtoMessage() {} func (*QueryGetProposedCertificateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{8} + return fileDescriptor_db6ffa8ae459ba1c, []int{10} } func (m *QueryGetProposedCertificateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -483,7 +575,7 @@ func (m *QueryGetProposedCertificateResponse) Reset() { *m = QueryGetPro func (m *QueryGetProposedCertificateResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetProposedCertificateResponse) ProtoMessage() {} func (*QueryGetProposedCertificateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{9} + return fileDescriptor_db6ffa8ae459ba1c, []int{11} } func (m *QueryGetProposedCertificateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -527,7 +619,7 @@ func (m *QueryAllProposedCertificateRequest) Reset() { *m = QueryAllProp func (m *QueryAllProposedCertificateRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllProposedCertificateRequest) ProtoMessage() {} func (*QueryAllProposedCertificateRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{10} + return fileDescriptor_db6ffa8ae459ba1c, []int{12} } func (m *QueryAllProposedCertificateRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -572,7 +664,7 @@ func (m *QueryAllProposedCertificateResponse) Reset() { *m = QueryAllPro func (m *QueryAllProposedCertificateResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllProposedCertificateResponse) ProtoMessage() {} func (*QueryAllProposedCertificateResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{11} + return fileDescriptor_db6ffa8ae459ba1c, []int{13} } func (m *QueryAllProposedCertificateResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -624,7 +716,7 @@ func (m *QueryGetChildCertificatesRequest) Reset() { *m = QueryGetChildC func (m *QueryGetChildCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetChildCertificatesRequest) ProtoMessage() {} func (*QueryGetChildCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{12} + return fileDescriptor_db6ffa8ae459ba1c, []int{14} } func (m *QueryGetChildCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -675,7 +767,7 @@ func (m *QueryGetChildCertificatesResponse) Reset() { *m = QueryGetChild func (m *QueryGetChildCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetChildCertificatesResponse) ProtoMessage() {} func (*QueryGetChildCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{13} + return fileDescriptor_db6ffa8ae459ba1c, []int{15} } func (m *QueryGetChildCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -725,7 +817,7 @@ func (m *QueryGetProposedCertificateRevocationRequest) String() string { } func (*QueryGetProposedCertificateRevocationRequest) ProtoMessage() {} func (*QueryGetProposedCertificateRevocationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{14} + return fileDescriptor_db6ffa8ae459ba1c, []int{16} } func (m *QueryGetProposedCertificateRevocationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -787,7 +879,7 @@ func (m *QueryGetProposedCertificateRevocationResponse) String() string { } func (*QueryGetProposedCertificateRevocationResponse) ProtoMessage() {} func (*QueryGetProposedCertificateRevocationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{15} + return fileDescriptor_db6ffa8ae459ba1c, []int{17} } func (m *QueryGetProposedCertificateRevocationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -835,7 +927,7 @@ func (m *QueryAllProposedCertificateRevocationRequest) String() string { } func (*QueryAllProposedCertificateRevocationRequest) ProtoMessage() {} func (*QueryAllProposedCertificateRevocationRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{16} + return fileDescriptor_db6ffa8ae459ba1c, []int{18} } func (m *QueryAllProposedCertificateRevocationRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -884,7 +976,7 @@ func (m *QueryAllProposedCertificateRevocationResponse) String() string { } func (*QueryAllProposedCertificateRevocationResponse) ProtoMessage() {} func (*QueryAllProposedCertificateRevocationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{17} + return fileDescriptor_db6ffa8ae459ba1c, []int{19} } func (m *QueryAllProposedCertificateRevocationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -936,7 +1028,7 @@ func (m *QueryGetRevokedCertificatesRequest) Reset() { *m = QueryGetRevo func (m *QueryGetRevokedCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetRevokedCertificatesRequest) ProtoMessage() {} func (*QueryGetRevokedCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{18} + return fileDescriptor_db6ffa8ae459ba1c, []int{20} } func (m *QueryGetRevokedCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -987,7 +1079,7 @@ func (m *QueryGetRevokedCertificatesResponse) Reset() { *m = QueryGetRev func (m *QueryGetRevokedCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetRevokedCertificatesResponse) ProtoMessage() {} func (*QueryGetRevokedCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{19} + return fileDescriptor_db6ffa8ae459ba1c, []int{21} } func (m *QueryGetRevokedCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1031,7 +1123,7 @@ func (m *QueryAllRevokedCertificatesRequest) Reset() { *m = QueryAllRevo func (m *QueryAllRevokedCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllRevokedCertificatesRequest) ProtoMessage() {} func (*QueryAllRevokedCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{20} + return fileDescriptor_db6ffa8ae459ba1c, []int{22} } func (m *QueryAllRevokedCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1076,7 +1168,7 @@ func (m *QueryAllRevokedCertificatesResponse) Reset() { *m = QueryAllRev func (m *QueryAllRevokedCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllRevokedCertificatesResponse) ProtoMessage() {} func (*QueryAllRevokedCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{21} + return fileDescriptor_db6ffa8ae459ba1c, []int{23} } func (m *QueryAllRevokedCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1128,7 +1220,7 @@ func (m *QueryGetApprovedRootCertificatesRequest) Reset() { func (m *QueryGetApprovedRootCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetApprovedRootCertificatesRequest) ProtoMessage() {} func (*QueryGetApprovedRootCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{22} + return fileDescriptor_db6ffa8ae459ba1c, []int{24} } func (m *QueryGetApprovedRootCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1167,7 +1259,7 @@ func (m *QueryGetApprovedRootCertificatesResponse) Reset() { func (m *QueryGetApprovedRootCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetApprovedRootCertificatesResponse) ProtoMessage() {} func (*QueryGetApprovedRootCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{23} + return fileDescriptor_db6ffa8ae459ba1c, []int{25} } func (m *QueryGetApprovedRootCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1212,7 +1304,7 @@ func (m *QueryGetRevokedRootCertificatesRequest) Reset() { func (m *QueryGetRevokedRootCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetRevokedRootCertificatesRequest) ProtoMessage() {} func (*QueryGetRevokedRootCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{24} + return fileDescriptor_db6ffa8ae459ba1c, []int{26} } func (m *QueryGetRevokedRootCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1251,7 +1343,7 @@ func (m *QueryGetRevokedRootCertificatesResponse) Reset() { func (m *QueryGetRevokedRootCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetRevokedRootCertificatesResponse) ProtoMessage() {} func (*QueryGetRevokedRootCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{25} + return fileDescriptor_db6ffa8ae459ba1c, []int{27} } func (m *QueryGetRevokedRootCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1299,7 +1391,7 @@ func (m *QueryGetApprovedCertificatesBySubjectRequest) String() string { } func (*QueryGetApprovedCertificatesBySubjectRequest) ProtoMessage() {} func (*QueryGetApprovedCertificatesBySubjectRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{26} + return fileDescriptor_db6ffa8ae459ba1c, []int{28} } func (m *QueryGetApprovedCertificatesBySubjectRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1347,7 +1439,7 @@ func (m *QueryGetApprovedCertificatesBySubjectResponse) String() string { } func (*QueryGetApprovedCertificatesBySubjectResponse) ProtoMessage() {} func (*QueryGetApprovedCertificatesBySubjectResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{27} + return fileDescriptor_db6ffa8ae459ba1c, []int{29} } func (m *QueryGetApprovedCertificatesBySubjectResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1392,7 +1484,7 @@ func (m *QueryGetRejectedCertificatesRequest) Reset() { *m = QueryGetRej func (m *QueryGetRejectedCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetRejectedCertificatesRequest) ProtoMessage() {} func (*QueryGetRejectedCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{28} + return fileDescriptor_db6ffa8ae459ba1c, []int{30} } func (m *QueryGetRejectedCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1443,7 +1535,7 @@ func (m *QueryGetRejectedCertificatesResponse) Reset() { *m = QueryGetRe func (m *QueryGetRejectedCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetRejectedCertificatesResponse) ProtoMessage() {} func (*QueryGetRejectedCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{29} + return fileDescriptor_db6ffa8ae459ba1c, []int{31} } func (m *QueryGetRejectedCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1487,7 +1579,7 @@ func (m *QueryAllRejectedCertificatesRequest) Reset() { *m = QueryAllRej func (m *QueryAllRejectedCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllRejectedCertificatesRequest) ProtoMessage() {} func (*QueryAllRejectedCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{30} + return fileDescriptor_db6ffa8ae459ba1c, []int{32} } func (m *QueryAllRejectedCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1532,7 +1624,7 @@ func (m *QueryAllRejectedCertificatesResponse) Reset() { *m = QueryAllRe func (m *QueryAllRejectedCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllRejectedCertificatesResponse) ProtoMessage() {} func (*QueryAllRejectedCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{31} + return fileDescriptor_db6ffa8ae459ba1c, []int{33} } func (m *QueryAllRejectedCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1589,7 +1681,7 @@ func (m *QueryGetPkiRevocationDistributionPointRequest) String() string { } func (*QueryGetPkiRevocationDistributionPointRequest) ProtoMessage() {} func (*QueryGetPkiRevocationDistributionPointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{32} + return fileDescriptor_db6ffa8ae459ba1c, []int{34} } func (m *QueryGetPkiRevocationDistributionPointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1651,7 +1743,7 @@ func (m *QueryGetPkiRevocationDistributionPointResponse) String() string { } func (*QueryGetPkiRevocationDistributionPointResponse) ProtoMessage() {} func (*QueryGetPkiRevocationDistributionPointResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{33} + return fileDescriptor_db6ffa8ae459ba1c, []int{35} } func (m *QueryGetPkiRevocationDistributionPointResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1699,7 +1791,7 @@ func (m *QueryAllPkiRevocationDistributionPointRequest) String() string { } func (*QueryAllPkiRevocationDistributionPointRequest) ProtoMessage() {} func (*QueryAllPkiRevocationDistributionPointRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{34} + return fileDescriptor_db6ffa8ae459ba1c, []int{36} } func (m *QueryAllPkiRevocationDistributionPointRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1748,7 +1840,7 @@ func (m *QueryAllPkiRevocationDistributionPointResponse) String() string { } func (*QueryAllPkiRevocationDistributionPointResponse) ProtoMessage() {} func (*QueryAllPkiRevocationDistributionPointResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{35} + return fileDescriptor_db6ffa8ae459ba1c, []int{37} } func (m *QueryAllPkiRevocationDistributionPointResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1803,7 +1895,7 @@ func (m *QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest) Str } func (*QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest) ProtoMessage() {} func (*QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{36} + return fileDescriptor_db6ffa8ae459ba1c, []int{38} } func (m *QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1851,7 +1943,7 @@ func (m *QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse) St } func (*QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse) ProtoMessage() {} func (*QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{37} + return fileDescriptor_db6ffa8ae459ba1c, []int{39} } func (m *QueryGetPkiRevocationDistributionPointsByIssuerSubjectKeyIDResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1895,7 +1987,7 @@ func (m *QueryGetNocRootCertificatesRequest) Reset() { *m = QueryGetNocR func (m *QueryGetNocRootCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNocRootCertificatesRequest) ProtoMessage() {} func (*QueryGetNocRootCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{38} + return fileDescriptor_db6ffa8ae459ba1c, []int{40} } func (m *QueryGetNocRootCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1939,7 +2031,7 @@ func (m *QueryGetNocRootCertificatesResponse) Reset() { *m = QueryGetNoc func (m *QueryGetNocRootCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNocRootCertificatesResponse) ProtoMessage() {} func (*QueryGetNocRootCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{39} + return fileDescriptor_db6ffa8ae459ba1c, []int{41} } func (m *QueryGetNocRootCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1983,7 +2075,7 @@ func (m *QueryAllNocRootCertificatesRequest) Reset() { *m = QueryAllNocR func (m *QueryAllNocRootCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllNocRootCertificatesRequest) ProtoMessage() {} func (*QueryAllNocRootCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{40} + return fileDescriptor_db6ffa8ae459ba1c, []int{42} } func (m *QueryAllNocRootCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2028,7 +2120,7 @@ func (m *QueryAllNocRootCertificatesResponse) Reset() { *m = QueryAllNoc func (m *QueryAllNocRootCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllNocRootCertificatesResponse) ProtoMessage() {} func (*QueryAllNocRootCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{41} + return fileDescriptor_db6ffa8ae459ba1c, []int{43} } func (m *QueryAllNocRootCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2079,7 +2171,7 @@ func (m *QueryGetNocIcaCertificatesRequest) Reset() { *m = QueryGetNocIc func (m *QueryGetNocIcaCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNocIcaCertificatesRequest) ProtoMessage() {} func (*QueryGetNocIcaCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{42} + return fileDescriptor_db6ffa8ae459ba1c, []int{44} } func (m *QueryGetNocIcaCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2123,7 +2215,7 @@ func (m *QueryGetNocIcaCertificatesResponse) Reset() { *m = QueryGetNocI func (m *QueryGetNocIcaCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNocIcaCertificatesResponse) ProtoMessage() {} func (*QueryGetNocIcaCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{43} + return fileDescriptor_db6ffa8ae459ba1c, []int{45} } func (m *QueryGetNocIcaCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2167,7 +2259,7 @@ func (m *QueryAllNocIcaCertificatesRequest) Reset() { *m = QueryAllNocIc func (m *QueryAllNocIcaCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllNocIcaCertificatesRequest) ProtoMessage() {} func (*QueryAllNocIcaCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{44} + return fileDescriptor_db6ffa8ae459ba1c, []int{46} } func (m *QueryAllNocIcaCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2212,7 +2304,7 @@ func (m *QueryAllNocIcaCertificatesResponse) Reset() { *m = QueryAllNocI func (m *QueryAllNocIcaCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllNocIcaCertificatesResponse) ProtoMessage() {} func (*QueryAllNocIcaCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{45} + return fileDescriptor_db6ffa8ae459ba1c, []int{47} } func (m *QueryAllNocIcaCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2268,7 +2360,7 @@ func (m *QueryGetRevokedNocRootCertificatesRequest) String() string { } func (*QueryGetRevokedNocRootCertificatesRequest) ProtoMessage() {} func (*QueryGetRevokedNocRootCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{46} + return fileDescriptor_db6ffa8ae459ba1c, []int{48} } func (m *QueryGetRevokedNocRootCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2323,7 +2415,7 @@ func (m *QueryGetRevokedNocRootCertificatesResponse) String() string { } func (*QueryGetRevokedNocRootCertificatesResponse) ProtoMessage() {} func (*QueryGetRevokedNocRootCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{47} + return fileDescriptor_db6ffa8ae459ba1c, []int{49} } func (m *QueryGetRevokedNocRootCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2371,7 +2463,7 @@ func (m *QueryAllRevokedNocRootCertificatesRequest) String() string { } func (*QueryAllRevokedNocRootCertificatesRequest) ProtoMessage() {} func (*QueryAllRevokedNocRootCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{48} + return fileDescriptor_db6ffa8ae459ba1c, []int{50} } func (m *QueryAllRevokedNocRootCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2420,7 +2512,7 @@ func (m *QueryAllRevokedNocRootCertificatesResponse) String() string { } func (*QueryAllRevokedNocRootCertificatesResponse) ProtoMessage() {} func (*QueryAllRevokedNocRootCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{49} + return fileDescriptor_db6ffa8ae459ba1c, []int{51} } func (m *QueryAllRevokedNocRootCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2474,7 +2566,7 @@ func (m *QueryGetRevokedNocIcaCertificatesRequest) Reset() { func (m *QueryGetRevokedNocIcaCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetRevokedNocIcaCertificatesRequest) ProtoMessage() {} func (*QueryGetRevokedNocIcaCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{50} + return fileDescriptor_db6ffa8ae459ba1c, []int{52} } func (m *QueryGetRevokedNocIcaCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2529,7 +2621,7 @@ func (m *QueryGetRevokedNocIcaCertificatesResponse) String() string { } func (*QueryGetRevokedNocIcaCertificatesResponse) ProtoMessage() {} func (*QueryGetRevokedNocIcaCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{51} + return fileDescriptor_db6ffa8ae459ba1c, []int{53} } func (m *QueryGetRevokedNocIcaCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2575,7 +2667,7 @@ func (m *QueryAllRevokedNocIcaCertificatesRequest) Reset() { func (m *QueryAllRevokedNocIcaCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllRevokedNocIcaCertificatesRequest) ProtoMessage() {} func (*QueryAllRevokedNocIcaCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{52} + return fileDescriptor_db6ffa8ae459ba1c, []int{54} } func (m *QueryAllRevokedNocIcaCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2624,7 +2716,7 @@ func (m *QueryAllRevokedNocIcaCertificatesResponse) String() string { } func (*QueryAllRevokedNocIcaCertificatesResponse) ProtoMessage() {} func (*QueryAllRevokedNocIcaCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{53} + return fileDescriptor_db6ffa8ae459ba1c, []int{55} } func (m *QueryAllRevokedNocIcaCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2680,7 +2772,7 @@ func (m *QueryGetNocCertificatesByVidAndSkidRequest) String() string { } func (*QueryGetNocCertificatesByVidAndSkidRequest) ProtoMessage() {} func (*QueryGetNocCertificatesByVidAndSkidRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{54} + return fileDescriptor_db6ffa8ae459ba1c, []int{56} } func (m *QueryGetNocCertificatesByVidAndSkidRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2735,7 +2827,7 @@ func (m *QueryGetNocCertificatesByVidAndSkidResponse) String() string { } func (*QueryGetNocCertificatesByVidAndSkidResponse) ProtoMessage() {} func (*QueryGetNocCertificatesByVidAndSkidResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{55} + return fileDescriptor_db6ffa8ae459ba1c, []int{57} } func (m *QueryGetNocCertificatesByVidAndSkidResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2780,7 +2872,7 @@ func (m *QueryNocCertificatesRequest) Reset() { *m = QueryNocCertificate func (m *QueryNocCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryNocCertificatesRequest) ProtoMessage() {} func (*QueryNocCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{56} + return fileDescriptor_db6ffa8ae459ba1c, []int{58} } func (m *QueryNocCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2832,7 +2924,7 @@ func (m *QueryNocCertificatesResponse) Reset() { *m = QueryNocCertificat func (m *QueryNocCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryNocCertificatesResponse) ProtoMessage() {} func (*QueryNocCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{57} + return fileDescriptor_db6ffa8ae459ba1c, []int{59} } func (m *QueryNocCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2885,7 +2977,7 @@ func (m *QueryGetNocCertificatesBySubjectRequest) Reset() { func (m *QueryGetNocCertificatesBySubjectRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNocCertificatesBySubjectRequest) ProtoMessage() {} func (*QueryGetNocCertificatesBySubjectRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{58} + return fileDescriptor_db6ffa8ae459ba1c, []int{60} } func (m *QueryGetNocCertificatesBySubjectRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2931,7 +3023,7 @@ func (m *QueryGetNocCertificatesBySubjectResponse) Reset() { func (m *QueryGetNocCertificatesBySubjectResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNocCertificatesBySubjectResponse) ProtoMessage() {} func (*QueryGetNocCertificatesBySubjectResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{59} + return fileDescriptor_db6ffa8ae459ba1c, []int{61} } func (m *QueryGetNocCertificatesBySubjectResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2976,7 +3068,7 @@ func (m *QueryGetNocCertificatesRequest) Reset() { *m = QueryGetNocCerti func (m *QueryGetNocCertificatesRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNocCertificatesRequest) ProtoMessage() {} func (*QueryGetNocCertificatesRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{60} + return fileDescriptor_db6ffa8ae459ba1c, []int{62} } func (m *QueryGetNocCertificatesRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3027,7 +3119,7 @@ func (m *QueryGetNocCertificatesResponse) Reset() { *m = QueryGetNocCert func (m *QueryGetNocCertificatesResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNocCertificatesResponse) ProtoMessage() {} func (*QueryGetNocCertificatesResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_db6ffa8ae459ba1c, []int{61} + return fileDescriptor_db6ffa8ae459ba1c, []int{63} } func (m *QueryGetNocCertificatesResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3066,6 +3158,8 @@ func (m *QueryGetNocCertificatesResponse) GetNocCertificates() NocCertificates { func init() { proto.RegisterType((*QueryAllCertificatesRequest)(nil), "zigbeealliance.distributedcomplianceledger.pki.QueryAllCertificatesRequest") proto.RegisterType((*QueryAllCertificatesResponse)(nil), "zigbeealliance.distributedcomplianceledger.pki.QueryAllCertificatesResponse") + proto.RegisterType((*QueryGetAllCertificatesBySubjectRequest)(nil), "zigbeealliance.distributedcomplianceledger.pki.QueryGetAllCertificatesBySubjectRequest") + proto.RegisterType((*QueryGetAllCertificatesBySubjectResponse)(nil), "zigbeealliance.distributedcomplianceledger.pki.QueryGetAllCertificatesBySubjectResponse") proto.RegisterType((*QueryGetCertificatesRequest)(nil), "zigbeealliance.distributedcomplianceledger.pki.QueryGetCertificatesRequest") proto.RegisterType((*QueryGetCertificatesResponse)(nil), "zigbeealliance.distributedcomplianceledger.pki.QueryGetCertificatesResponse") proto.RegisterType((*QueryGetApprovedCertificatesRequest)(nil), "zigbeealliance.distributedcomplianceledger.pki.QueryGetApprovedCertificatesRequest") @@ -3133,168 +3227,172 @@ func init() { } var fileDescriptor_db6ffa8ae459ba1c = []byte{ - // 2563 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5c, 0x5f, 0x6c, 0x1c, 0x47, - 0x19, 0xcf, 0xdc, 0x91, 0xa2, 0x4e, 0x23, 0x42, 0x27, 0x69, 0xe2, 0x5c, 0x62, 0x27, 0x99, 0x26, - 0xb6, 0x93, 0xd4, 0x77, 0x24, 0xa1, 0x09, 0x54, 0x6a, 0x82, 0x1d, 0xb7, 0xae, 0x53, 0x70, 0xed, - 0x73, 0x9b, 0x26, 0x69, 0xc9, 0x69, 0x6f, 0x6f, 0x71, 0x16, 0xaf, 0x6f, 0xaf, 0x7b, 0x67, 0x53, - 0x63, 0x19, 0x41, 0x05, 0x2d, 0x45, 0x02, 0x85, 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, 0x09, 0x59, 0x4b, 0xc0, 0xb1, - 0x39, 0x96, 0x67, 0x1b, 0xce, 0xdc, 0xea, 0x4a, 0xdd, 0xf2, 0x86, 0x8a, 0x30, 0x27, 0xf6, 0x1b, - 0xfd, 0x35, 0xc2, 0x13, 0x39, 0x97, 0x04, 0xdc, 0xfd, 0x10, 0xe1, 0xe1, 0x96, 0x6c, 0x26, 0x10, - 0xf9, 0x05, 0x0d, 0x6e, 0x19, 0x09, 0x05, 0x52, 0xe5, 0x9a, 0xe9, 0x1a, 0xf0, 0x2b, 0x0a, 0xa7, - 0x34, 0xbf, 0xba, 0xe2, 0xf8, 0x07, 0x05, 0x60, 0xb1, 0xbb, 0xe2, 0x1e, 0x58, 0x2c, 0xde, 0x1d, - 0x16, 0x07, 0xb2, 0xab, 0x54, 0x83, 0x6b, 0x81, 0xfe, 0x83, 0x4e, 0x7c, 0x57, 0xe1, 0x2a, 0x89, - 0x52, 0xa8, 0x97, 0x1d, 0x56, 0xdd, 0x55, 0x38, 0x9a, 0xc2, 0x14, 0xca, 0xd1, 0x12, 0xdf, 0x55, - 0x24, 0x44, 0x0c, 0x62, 0x57, 0x51, 0xa2, 0xa4, 0x38, 0x78, 0x4a, 0xf4, 0x39, 0xd9, 0x09, 0x3c, - 0x96, 0x3e, 0xe8, 0x56, 0x5d, 0x97, 0x77, 0x87, 0xa0, 0x3f, 0x47, 0x78, 0xbc, 0xfb, 0x5c, 0x60, - 0xe7, 0x3b, 0x08, 0x0f, 0x19, 0x82, 0x49, 0x60, 0x9c, 0x27, 0x54, 0x0f, 0x78, 0x69, 0x79, 0x40, - 0x94, 0x50, 0x1f, 0x1d, 0xc7, 0xa3, 0x29, 0x27, 0x17, 0x61, 0xfc, 0x19, 0x8a, 0xf8, 0x10, 0x4e, - 0x05, 0x88, 0xaf, 0x20, 0xbc, 0xdf, 0xe3, 0xcf, 0x01, 0x84, 0x33, 0x8a, 0x5e, 0x20, 0x00, 0x28, - 0xd2, 0x46, 0x9f, 0x88, 0x36, 0x46, 0xee, 0x21, 0x78, 0x7d, 0x31, 0x88, 0xf9, 0xae, 0x39, 0x23, - 0xb1, 0xa1, 0x75, 0x11, 0x15, 0x4b, 0xc5, 0x86, 0x6c, 0xa6, 0xea, 0x86, 0x26, 0x55, 0x1f, 0xa6, - 0x62, 0xa9, 0xe6, 0xf8, 0x5d, 0xb1, 0x0a, 0x65, 0x3e, 0xfd, 0x29, 0xf4, 0xad, 0xd8, 0x5d, 0x91, - 0xaf, 0x25, 0x9e, 0x30, 0x32, 0xe3, 0xea, 0x39, 0x34, 0x23, 0x2a, 0x4a, 0x18, 0x99, 0x21, 0xba, - 0x12, 0x4f, 0x6a, 0x62, 0x2a, 0x74, 0x25, 0xd1, 0x8f, 0x62, 0x77, 0x40, 0x35, 0x52, 0x8a, 0x83, - 0x27, 0x45, 0x5f, 0x16, 0x7d, 0x25, 0x7e, 0x0e, 0x5c, 0xb6, 0xa3, 0xd3, 0xc0, 0x74, 0xac, 0x56, - 0x3b, 0xef, 0xda, 0xcd, 0xad, 0x10, 0xfc, 0x24, 0x2e, 0xae, 0xd9, 0x0d, 0xc6, 0xf0, 0xce, 0xaa, - 0xff, 0x91, 0xec, 0xc5, 0x3b, 0x1d, 0xa3, 0x6e, 0x39, 0xe0, 0x64, 0xc1, 0x17, 0x52, 0xc6, 0x24, - 0x38, 0xc3, 0x2f, 0x46, 0x3e, 0x37, 0x0d, 0x67, 0x51, 0xce, 0x08, 0x7d, 0x17, 0xe1, 0x72, 0xde, - 0x95, 0x80, 0x09, 0xde, 0x44, 0x78, 0x44, 0x3e, 0x15, 0x1c, 0x61, 0xae, 0xe7, 0xd3, 0x94, 0x54, - 0x2a, 0x58, 0xa6, 0x8b, 0x6e, 0xfa, 0x95, 0xd8, 0xe1, 0x30, 0x17, 0xb5, 0xba, 0x7c, 0xf8, 0x8d, - 0x02, 0x50, 0x99, 0x43, 0x73, 0x2f, 0x54, 0x16, 0xef, 0x16, 0x95, 0xfa, 0xfc, 0x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x1b, 0x80, 0x64, 0xa0, 0xe0, 0x71, 0x46, 0xc1, 0xe7, 0xc8, - 0x05, 0x2e, 0x05, 0xd9, 0xbc, 0x20, 0xf2, 0x91, 0x97, 0x0a, 0xf8, 0x90, 0x50, 0x9b, 0xef, 0x22, - 0x57, 0xfb, 0xb7, 0xa3, 0x56, 0x76, 0xf2, 0x74, 0x0c, 0xd1, 0x09, 0xc6, 0xce, 0x18, 0x39, 0x9e, - 0x8b, 0x9d, 0xa9, 0x1b, 0xef, 0xdc, 0x1e, 0x41, 0xef, 0xdd, 0x1e, 0x41, 0x7f, 0xba, 0x3d, 0x82, - 0x6e, 0xdd, 0x19, 0xd9, 0xf1, 0xde, 0x9d, 0x91, 0x1d, 0xef, 0xdf, 0x19, 0xd9, 0x71, 0x7d, 0x7a, - 0xc9, 0xee, 0xdc, 0x5c, 0xad, 0x97, 0x4d, 0x77, 0xa5, 0x12, 0xac, 0x76, 0x82, 0xf7, 0xef, 0x52, - 0x26, 0xa2, 0xf5, 0x4e, 0xc0, 0x3f, 0x4c, 0x79, 0x91, 0xa9, 0xed, 0xac, 0xb7, 0xac, 0x76, 0xfd, - 0x1e, 0xf6, 0xcf, 0x4e, 0xce, 0xfe, 0x3f, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf2, 0x5e, 0xb7, 0xd8, - 0x4b, 0x00, 0x00, + // 2629 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x5c, 0x5f, 0x6c, 0x5c, 0x47, + 0xf5, 0xce, 0xec, 0xfe, 0xd2, 0x9f, 0x3a, 0x8d, 0x08, 0x9d, 0xa4, 0x89, 0xb3, 0x89, 0x1d, 0x67, + 0xda, 0xd8, 0x8e, 0x83, 0x77, 0x9b, 0x84, 0x26, 0x50, 0xa9, 0x4d, 0xed, 0xb8, 0x75, 0x9d, 0x80, + 0x6b, 0xaf, 0xdb, 0x34, 0x49, 0x4b,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c, 0xf4, 0xc5, + 0x52, 0xd0, 0x4d, 0x46, 0x1f, 0x65, 0xc0, 0x3e, 0x4d, 0x4e, 0xa7, 0x00, 0xd6, 0x79, 0xc5, 0x16, + 0xd5, 0x36, 0xb9, 0x83, 0xf0, 0x41, 0xde, 0x2f, 0x07, 0x9e, 0x7c, 0x97, 0x55, 0x15, 0x27, 0xe9, + 0xac, 0x2a, 0x3c, 0xab, 0xd7, 0x28, 0x50, 0x30, 0xcc, 0x28, 0x38, 0x48, 0x1e, 0xe8, 0x50, 0x10, + 0x91, 0xf2, 0x37, 0x72, 0x78, 0x58, 0xfa, 0xfb, 0x08, 0x79, 0x51, 0x59, 0x76, 0x29, 0x7e, 0x40, + 0x2a, 0x7c, 0x61, 0x40, 0xd6, 0x01, 0xfd, 0x38, 0x43, 0x7f, 0x8c, 0x1c, 0xe5, 0xa2, 0x0f, 0xa9, + 0xfa, 0x5f, 0x08, 0xef, 0xe7, 0x99, 0x54, 0x0c, 0xb5, 0xbc, 0xa7, 0x50, 0x31, 0xd4, 0x3d, 0x5a, + 0x08, 0xe9, 0x59, 0x06, 0xf6, 0x61, 0x52, 0xec, 0x01, 0x36, 0xae, 0xf4, 0xff, 0x22, 0xbc, 0x8f, + 0xd3, 0xae, 0x40, 0xca, 0xaa, 0xb3, 0x14, 0x77, 0x6c, 0x15, 0x96, 0xb5, 0xda, 0x04, 0xe0, 0xe7, + 0x19, 0xf0, 0xcf, 0x92, 0x73, 0x1d, 0xe0, 0x41, 0x63, 0x45, 0xca, 0xb5, 0xfe, 0x67, 0x84, 0x0f, + 0x70, 0x1c, 0x78, 0x4b, 0xbd, 0xac, 0xba, 0x2a, 0xb5, 0x93, 0x20, 0xef, 0x4d, 0xa3, 0x63, 0x8c, + 0x84, 0x51, 0x32, 0x22, 0x27, 0x81, 0xfc, 0x13, 0xe1, 0xfb, 0x13, 0xbd, 0x52, 0x64, 0x51, 0x39, + 0xef, 0x0a, 0x3a, 0xc8, 0x0a, 0x4b, 0x1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55, 0xbd, 0x87, 0xfd, 0xd3, 0x9b, 0x33, 0xff, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x88, 0x3d, 0x13, + 0x23, 0x32, 0x4e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -3311,6 +3409,8 @@ const _ = grpc.SupportPackageIsVersion4 type QueryClient interface { // Queries a list of Certificates items. CertificatesAll(ctx context.Context, in *QueryAllCertificatesRequest, opts ...grpc.CallOption) (*QueryAllCertificatesResponse, error) + // Queries a AllCertificatesBySubject by index. + AllCertificatesBySubject(ctx context.Context, in *QueryGetAllCertificatesBySubjectRequest, opts ...grpc.CallOption) (*QueryGetAllCertificatesBySubjectResponse, error) // Queries a Certificates by index. Certificates(ctx context.Context, in *QueryGetCertificatesRequest, opts ...grpc.CallOption) (*QueryGetCertificatesResponse, error) // Queries a list of ApprovedCertificates items. @@ -3390,6 +3490,15 @@ func (c *queryClient) CertificatesAll(ctx context.Context, in *QueryAllCertifica return out, nil } +func (c *queryClient) AllCertificatesBySubject(ctx context.Context, in *QueryGetAllCertificatesBySubjectRequest, opts ...grpc.CallOption) (*QueryGetAllCertificatesBySubjectResponse, error) { + out := new(QueryGetAllCertificatesBySubjectResponse) + err := c.cc.Invoke(ctx, "/zigbeealliance.distributedcomplianceledger.pki.Query/AllCertificatesBySubject", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *queryClient) Certificates(ctx context.Context, in *QueryGetCertificatesRequest, opts ...grpc.CallOption) (*QueryGetCertificatesResponse, error) { out := new(QueryGetCertificatesResponse) err := c.cc.Invoke(ctx, "/zigbeealliance.distributedcomplianceledger.pki.Query/Certificates", in, out, opts...) @@ -3664,6 +3773,8 @@ func (c *queryClient) RevokedNocIcaCertificatesAll(ctx context.Context, in *Quer type QueryServer interface { // Queries a list of Certificates items. CertificatesAll(context.Context, *QueryAllCertificatesRequest) (*QueryAllCertificatesResponse, error) + // Queries a AllCertificatesBySubject by index. + AllCertificatesBySubject(context.Context, *QueryGetAllCertificatesBySubjectRequest) (*QueryGetAllCertificatesBySubjectResponse, error) // Queries a Certificates by index. Certificates(context.Context, *QueryGetCertificatesRequest) (*QueryGetCertificatesResponse, error) // Queries a list of ApprovedCertificates items. @@ -3733,6 +3844,9 @@ type UnimplementedQueryServer struct { func (*UnimplementedQueryServer) CertificatesAll(ctx context.Context, req *QueryAllCertificatesRequest) (*QueryAllCertificatesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CertificatesAll not implemented") } +func (*UnimplementedQueryServer) AllCertificatesBySubject(ctx context.Context, req *QueryGetAllCertificatesBySubjectRequest) (*QueryGetAllCertificatesBySubjectResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllCertificatesBySubject not implemented") +} func (*UnimplementedQueryServer) Certificates(ctx context.Context, req *QueryGetCertificatesRequest) (*QueryGetCertificatesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Certificates not implemented") } @@ -3846,6 +3960,24 @@ func _Query_CertificatesAll_Handler(srv interface{}, ctx context.Context, dec fu return interceptor(ctx, in, info, handler) } +func _Query_AllCertificatesBySubject_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetAllCertificatesBySubjectRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllCertificatesBySubject(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/zigbeealliance.distributedcomplianceledger.pki.Query/AllCertificatesBySubject", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllCertificatesBySubject(ctx, req.(*QueryGetAllCertificatesBySubjectRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Query_Certificates_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryGetCertificatesRequest) if err := dec(in); err != nil { @@ -4394,6 +4526,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "CertificatesAll", Handler: _Query_CertificatesAll_Handler, }, + { + MethodName: "AllCertificatesBySubject", + Handler: _Query_AllCertificatesBySubject_Handler, + }, { MethodName: "Certificates", Handler: _Query_Certificates_Handler, @@ -4603,6 +4739,69 @@ func (m *QueryAllCertificatesResponse) MarshalToSizedBuffer(dAtA []byte) (int, e return len(dAtA) - i, nil } +func (m *QueryGetAllCertificatesBySubjectRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetAllCertificatesBySubjectRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetAllCertificatesBySubjectRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Subject) > 0 { + i -= len(m.Subject) + copy(dAtA[i:], m.Subject) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Subject))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetAllCertificatesBySubjectResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryGetAllCertificatesBySubjectResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetAllCertificatesBySubjectResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AllCertificatesBySubject.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *QueryGetCertificatesRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6857,6 +7056,30 @@ func (m *QueryAllCertificatesResponse) Size() (n int) { return n } +func (m *QueryGetAllCertificatesBySubjectRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Subject) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetAllCertificatesBySubjectResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.AllCertificatesBySubject.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + func (m *QueryGetCertificatesRequest) Size() (n int) { if m == nil { return 0 @@ -7929,6 +8152,171 @@ func (m *QueryAllCertificatesResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryGetAllCertificatesBySubjectRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetAllCertificatesBySubjectRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetAllCertificatesBySubjectRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Subject", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Subject = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryGetAllCertificatesBySubjectResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryGetAllCertificatesBySubjectResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetAllCertificatesBySubjectResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllCertificatesBySubject", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AllCertificatesBySubject.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryGetCertificatesRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/pki/types/query.pb.gw.go b/x/pki/types/query.pb.gw.go index 8ae25e3f0..67ac490bb 100644 --- a/x/pki/types/query.pb.gw.go +++ b/x/pki/types/query.pb.gw.go @@ -69,6 +69,60 @@ func local_request_Query_CertificatesAll_0(ctx context.Context, marshaler runtim } +func request_Query_AllCertificatesBySubject_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAllCertificatesBySubjectRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["subject"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subject") + } + + protoReq.Subject, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subject", err) + } + + msg, err := client.AllCertificatesBySubject(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllCertificatesBySubject_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAllCertificatesBySubjectRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["subject"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "subject") + } + + protoReq.Subject, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "subject", err) + } + + msg, err := server.AllCertificatesBySubject(ctx, &protoReq) + return msg, metadata, err + +} + func request_Query_Certificates_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryGetCertificatesRequest var metadata runtime.ServerMetadata @@ -1752,6 +1806,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AllCertificatesBySubject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AllCertificatesBySubject_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllCertificatesBySubject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Certificates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -2503,6 +2580,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AllCertificatesBySubject_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AllCertificatesBySubject_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllCertificatesBySubject_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + mux.Handle("GET", pattern_Query_Certificates_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -3109,6 +3206,8 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie var ( pattern_Query_CertificatesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dcl", "pki", "all-certificates"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_AllCertificatesBySubject_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dcl", "pki", "all-certificates", "subject"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_Certificates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"dcl", "pki", "all-certificates", "subject", "subjectKeyId"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_ApprovedCertificatesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dcl", "pki", "certificates"}, "", runtime.AssumeColonVerbOpt(false))) @@ -3151,13 +3250,13 @@ var ( pattern_Query_NocCertificates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"dcl", "pki", "all-noc-certificates", "subject", "subjectKeyId"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_NocCertificatesByVidAndSkid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"dcl", "pki", "noc-certificates", "vid", "subjectKeyId"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_NocCertificatesByVidAndSkid_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 1, 0, 4, 1, 5, 4}, []string{"dcl", "pki", "noc-vid-certificates", "vid", "subjectKeyId"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_NocRootCertificates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dcl", "pki", "noc-root-certificates", "vid"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_NocRootCertificates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dcl", "pki", "noc-vid-root-certificates", "vid"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_NocRootCertificatesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dcl", "pki", "noc-root-certificates"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_NocIcaCertificates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dcl", "pki", "noc-ica-certificates", "vid"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_NocIcaCertificates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dcl", "pki", "noc-vid-ica-certificates", "vid"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_NocIcaCertificatesAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"dcl", "pki", "noc-ica-certificates"}, "", runtime.AssumeColonVerbOpt(false))) @@ -3173,6 +3272,8 @@ var ( var ( forward_Query_CertificatesAll_0 = runtime.ForwardResponseMessage + forward_Query_AllCertificatesBySubject_0 = runtime.ForwardResponseMessage + forward_Query_Certificates_0 = runtime.ForwardResponseMessage forward_Query_ApprovedCertificatesAll_0 = runtime.ForwardResponseMessage