diff --git a/.github/workflows/rust-build.yml b/.github/workflows/rust-build.yml new file mode 100644 index 00000000..d28224ce --- /dev/null +++ b/.github/workflows/rust-build.yml @@ -0,0 +1,49 @@ +# +# Copyright 2023 The Sigstore Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Check Rust build + +permissions: + contents: read + +on: + push: + paths: + - "**.proto" + - "gen/pb-rust/**" + pull_request: + paths: + - "**.proto" + - "gen/pb-rust/**" + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + - beta + - nightly + + steps: + - uses: actions/checkout@v3 + - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - run: | + cd gen/pb-rust + cargo build --verbose diff --git a/Dockerfile b/Dockerfile index 1bec71e2..70061ca6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,14 @@ RUN set -ex && \ apt-get install -y --no-install-recommends \ python3-pip +# Install Rust cargo. +RUN set -ex && \ + apt-get install -y --no-install-recommends \ + curl \ + build-essential +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + # Install Python dev dependencies. COPY ./dev-requirements.txt /tmp/ RUN python3 -m pip install --upgrade pip && \ diff --git a/Makefile b/Makefile index ddceed78..8a0263c4 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ PROTOC_IMAGE=protobuf-specs-build # generate all language protobuf code -all: go python typescript ruby +all: go python typescript ruby rust # generate Go protobuf code go: docker-image @@ -49,6 +49,16 @@ ruby: docker-image --entrypoint bash ${PROTOC_IMAGE} \ -c "cd ./gen/pb-ruby && protoc -I/opt/include -I../../protos/ --ruby_out=lib ../../protos/*.proto" +rust: docker-image + @echo "Generating rust protobuf files" + docker run \ + --platform linux/amd64 \ + -v ${PWD}:/defs \ + -e "RUST_BACKTRACE=1" \ + --entrypoint bash ${PROTOC_IMAGE} \ + -c "cd gen/pb-rust/codegen && cargo run" + + # docker already does its own caching so we can attempt a build every time .PHONY: docker-image docker-image: @@ -60,7 +70,8 @@ clean: rm -rf gen/pb-go \ gen/pb-typescript/src/__generated__ \ gen/pb-python/sigstore_protobuf_specs/dev \ - gen/pb-python/sigstore_protobuf_specs/io + gen/pb-python/sigstore_protobuf_specs/io \ + gen/pb-rust/target docker rmi -f ${PROTOC_IMAGE} help: diff --git a/RELEASE.md b/RELEASE.md index 592716f6..31197c6b 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -90,6 +90,12 @@ Prepare a tag with the following pattern `release/python/vX.Y.Z` and push it. The [workflow](.github/workflows/python-release.yml) will automatically start. +### Rust + +Prepare a tag with the following pattern `release/rust/vX.Y.Z` and +push it. The [workflow](.github/workflows/rust-release.yml) +will automatically start. + ### TypeScript Prepare a tag with the following pattern `release/typescript/vX.Y.Z` and diff --git a/gen/pb-rust/.gitignore b/gen/pb-rust/.gitignore new file mode 100644 index 00000000..eb5a316c --- /dev/null +++ b/gen/pb-rust/.gitignore @@ -0,0 +1 @@ +target diff --git a/gen/pb-rust/Cargo.lock b/gen/pb-rust/Cargo.lock new file mode 100644 index 00000000..5d73a352 --- /dev/null +++ b/gen/pb-rust/Cargo.lock @@ -0,0 +1,16 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + +[[package]] +name = "sigstore_protobuf_specs" +version = "0.1.0-rc.0" +dependencies = [ + "protobuf", +] diff --git a/gen/pb-rust/Cargo.toml b/gen/pb-rust/Cargo.toml new file mode 100644 index 00000000..8eaea420 --- /dev/null +++ b/gen/pb-rust/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "sigstore_protobuf_specs" +version = "0.1.0-rc.0" +exclude = ["codegen/"] +authors = ["Sigstore Authors "] +edition = "2021" +homepage = "https://github.com/sigstore/protobuf-specs" +repository = "https://github.com/sigstore/protobuf-specs" +description = "A library for serializing and deserializing Sigstore messages" +readme = "README.md" +license-file = "LICENSE" +keywords = ["sigstore"] +categories = ["encoding", "parser-implementations"] + +[dependencies] +protobuf = "2.28" + +[lib] +path = "src/mod.rs" diff --git a/gen/pb-rust/LICENSE b/gen/pb-rust/LICENSE new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/gen/pb-rust/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/gen/pb-rust/README.md b/gen/pb-rust/README.md new file mode 100644 index 00000000..5ae2915a --- /dev/null +++ b/gen/pb-rust/README.md @@ -0,0 +1,7 @@ +sigstore-protobuf-specs +======================= + +Rust language bindings for Sigstore's protobuf specs. + +See the [sigstore's protobuf-specs](https://github.com/sigstore/protobuf-specs) +for more information. diff --git a/gen/pb-rust/codegen/Cargo.lock b/gen/pb-rust/codegen/Cargo.lock new file mode 100644 index 00000000..07c08a70 --- /dev/null +++ b/gen/pb-rust/codegen/Cargo.lock @@ -0,0 +1,278 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys", +] + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "log" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + +[[package]] +name = "protobuf-codegen" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "033460afb75cf755fcfc16dfaed20b86468082a2ea24e05ac35ab4a099a017d6" +dependencies = [ + "protobuf", +] + +[[package]] +name = "protoc" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0218039c514f9e14a5060742ecd50427f8ac4f85a6dc58f2ddb806e318c55ee" +dependencies = [ + "log", + "which", +] + +[[package]] +name = "protoc-rust" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f8a182bb17c485f20bdc4274a8c39000a61024cfe461c799b50fec77267838" +dependencies = [ + "protobuf", + "protobuf-codegen", + "protoc", + "tempfile", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + +[[package]] +name = "rustix" +version = "0.37.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8818fa822adcc98b18fedbb3632a6a33213c070556b5aa7c4c8cc21cff565c4c" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "sigstore_protobuf_specs_codegen" +version = "0.1.0" +dependencies = [ + "glob", + "protoc-rust", +] + +[[package]] +name = "tempfile" +version = "3.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +dependencies = [ + "autocfg", + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys", +] + +[[package]] +name = "which" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +dependencies = [ + "either", + "libc", + "once_cell", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" diff --git a/gen/pb-rust/codegen/Cargo.toml b/gen/pb-rust/codegen/Cargo.toml new file mode 100644 index 00000000..6f238b31 --- /dev/null +++ b/gen/pb-rust/codegen/Cargo.toml @@ -0,0 +1,12 @@ +[package] +name = "sigstore_protobuf_specs_codegen" +version = "0.1.0" +authors = ["Sigstore Authors "] +edition = "2021" +description = "Rust AOT codegen for sigstore protobuf-specs" +readme = "../README.md" +license-file = "../LICENSE" + +[dependencies] +protoc-rust = "2.28" +glob = "0.3" diff --git a/gen/pb-rust/codegen/src/main.rs b/gen/pb-rust/codegen/src/main.rs new file mode 100644 index 00000000..becbfb60 --- /dev/null +++ b/gen/pb-rust/codegen/src/main.rs @@ -0,0 +1,25 @@ +use glob::glob; +extern crate protoc_rust; + +fn main() { + protoc_rust::Codegen::new() + .includes([ + concat!(env!("CARGO_MANIFEST_DIR"), "/../../../protos"), + "/opt/include", + ]) + .inputs( + glob(concat!( + env!("CARGO_MANIFEST_DIR"), + "/../../../protos/*.proto" + )) + .expect("invalid protobuf inputs!") + .flatten(), + ) + .out_dir("../src") + .customize(protoc_rust::Customize { + gen_mod_rs: Some(true), + ..Default::default() + }) + .run() + .expect("Running protoc failed."); +} diff --git a/gen/pb-rust/src/envelope.rs b/gen/pb-rust/src/envelope.rs new file mode 100644 index 00000000..0d3e3cf2 --- /dev/null +++ b/gen/pb-rust/src/envelope.rs @@ -0,0 +1,496 @@ +// This file is generated by rust-protobuf 2.28.0. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `envelope.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; + +#[derive(PartialEq,Clone,Default)] +pub struct Envelope { + // message fields + pub payload: ::std::vec::Vec, + pub payloadType: ::std::string::String, + pub signatures: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Envelope { + fn default() -> &'a Envelope { + ::default_instance() + } +} + +impl Envelope { + pub fn new() -> Envelope { + ::std::default::Default::default() + } + + // bytes payload = 1; + + + pub fn get_payload(&self) -> &[u8] { + &self.payload + } + pub fn clear_payload(&mut self) { + self.payload.clear(); + } + + // Param is passed by value, moved + pub fn set_payload(&mut self, v: ::std::vec::Vec) { + self.payload = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_payload(&mut self) -> &mut ::std::vec::Vec { + &mut self.payload + } + + // Take field + pub fn take_payload(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.payload, ::std::vec::Vec::new()) + } + + // string payloadType = 2; + + + pub fn get_payloadType(&self) -> &str { + &self.payloadType + } + pub fn clear_payloadType(&mut self) { + self.payloadType.clear(); + } + + // Param is passed by value, moved + pub fn set_payloadType(&mut self, v: ::std::string::String) { + self.payloadType = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_payloadType(&mut self) -> &mut ::std::string::String { + &mut self.payloadType + } + + // Take field + pub fn take_payloadType(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.payloadType, ::std::string::String::new()) + } + + // repeated .io.intoto.Signature signatures = 3; + + + pub fn get_signatures(&self) -> &[Signature] { + &self.signatures + } + pub fn clear_signatures(&mut self) { + self.signatures.clear(); + } + + // Param is passed by value, moved + pub fn set_signatures(&mut self, v: ::protobuf::RepeatedField) { + self.signatures = v; + } + + // Mutable pointer to the field. + pub fn mut_signatures(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.signatures + } + + // Take field + pub fn take_signatures(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.signatures, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for Envelope { + fn is_initialized(&self) -> bool { + for v in &self.signatures { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.payload)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.payloadType)?; + }, + 3 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.signatures)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.payload.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.payload); + } + if !self.payloadType.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.payloadType); + } + for value in &self.signatures { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.payload.is_empty() { + os.write_bytes(1, &self.payload)?; + } + if !self.payloadType.is_empty() { + os.write_string(2, &self.payloadType)?; + } + for v in &self.signatures { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Envelope { + Envelope::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "payload", + |m: &Envelope| { &m.payload }, + |m: &mut Envelope| { &mut m.payload }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "payloadType", + |m: &Envelope| { &m.payloadType }, + |m: &mut Envelope| { &mut m.payloadType }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "signatures", + |m: &Envelope| { &m.signatures }, + |m: &mut Envelope| { &mut m.signatures }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "Envelope", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static Envelope { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(Envelope::new) + } +} + +impl ::protobuf::Clear for Envelope { + fn clear(&mut self) { + self.payload.clear(); + self.payloadType.clear(); + self.signatures.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Envelope { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Envelope { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Signature { + // message fields + pub sig: ::std::vec::Vec, + pub keyid: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Signature { + fn default() -> &'a Signature { + ::default_instance() + } +} + +impl Signature { + pub fn new() -> Signature { + ::std::default::Default::default() + } + + // bytes sig = 1; + + + pub fn get_sig(&self) -> &[u8] { + &self.sig + } + pub fn clear_sig(&mut self) { + self.sig.clear(); + } + + // Param is passed by value, moved + pub fn set_sig(&mut self, v: ::std::vec::Vec) { + self.sig = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_sig(&mut self) -> &mut ::std::vec::Vec { + &mut self.sig + } + + // Take field + pub fn take_sig(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.sig, ::std::vec::Vec::new()) + } + + // string keyid = 2; + + + pub fn get_keyid(&self) -> &str { + &self.keyid + } + pub fn clear_keyid(&mut self) { + self.keyid.clear(); + } + + // Param is passed by value, moved + pub fn set_keyid(&mut self, v: ::std::string::String) { + self.keyid = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_keyid(&mut self) -> &mut ::std::string::String { + &mut self.keyid + } + + // Take field + pub fn take_keyid(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.keyid, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for Signature { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.sig)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.keyid)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.sig.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.sig); + } + if !self.keyid.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.keyid); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.sig.is_empty() { + os.write_bytes(1, &self.sig)?; + } + if !self.keyid.is_empty() { + os.write_string(2, &self.keyid)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Signature { + Signature::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "sig", + |m: &Signature| { &m.sig }, + |m: &mut Signature| { &mut m.sig }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "keyid", + |m: &Signature| { &m.keyid }, + |m: &mut Signature| { &mut m.keyid }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "Signature", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static Signature { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(Signature::new) + } +} + +impl ::protobuf::Clear for Signature { + fn clear(&mut self) { + self.sig.clear(); + self.keyid.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Signature { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Signature { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x0eenvelope.proto\x12\tio.intoto\"|\n\x08Envelope\x12\x18\n\x07payloa\ + d\x18\x01\x20\x01(\x0cR\x07payload\x12\x20\n\x0bpayloadType\x18\x02\x20\ + \x01(\tR\x0bpayloadType\x124\n\nsignatures\x18\x03\x20\x03(\x0b2\x14.io.\ + intoto.SignatureR\nsignatures\"3\n\tSignature\x12\x10\n\x03sig\x18\x01\ + \x20\x01(\x0cR\x03sig\x12\x14\n\x05keyid\x18\x02\x20\x01(\tR\x05keyidB3Z\ + 1github.com/sigstore/protobuf-specs/gen/pb-go/dsseb\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/gen/pb-rust/src/mod.rs b/gen/pb-rust/src/mod.rs new file mode 100644 index 00000000..89efae08 --- /dev/null +++ b/gen/pb-rust/src/mod.rs @@ -0,0 +1,8 @@ +// @generated + +pub mod envelope; +pub mod sigstore_bundle; +pub mod sigstore_common; +pub mod sigstore_rekor; +pub mod sigstore_trustroot; +pub mod sigstore_verification; diff --git a/gen/pb-rust/src/sigstore_bundle.rs b/gen/pb-rust/src/sigstore_bundle.rs new file mode 100644 index 00000000..5b8731ae --- /dev/null +++ b/gen/pb-rust/src/sigstore_bundle.rs @@ -0,0 +1,997 @@ +// This file is generated by rust-protobuf 2.28.0. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `sigstore_bundle.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; + +#[derive(PartialEq,Clone,Default)] +pub struct TimestampVerificationData { + // message fields + pub rfc3161_timestamps: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a TimestampVerificationData { + fn default() -> &'a TimestampVerificationData { + ::default_instance() + } +} + +impl TimestampVerificationData { + pub fn new() -> TimestampVerificationData { + ::std::default::Default::default() + } + + // repeated .dev.sigstore.common.v1.RFC3161SignedTimestamp rfc3161_timestamps = 1; + + + pub fn get_rfc3161_timestamps(&self) -> &[super::sigstore_common::RFC3161SignedTimestamp] { + &self.rfc3161_timestamps + } + pub fn clear_rfc3161_timestamps(&mut self) { + self.rfc3161_timestamps.clear(); + } + + // Param is passed by value, moved + pub fn set_rfc3161_timestamps(&mut self, v: ::protobuf::RepeatedField) { + self.rfc3161_timestamps = v; + } + + // Mutable pointer to the field. + pub fn mut_rfc3161_timestamps(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.rfc3161_timestamps + } + + // Take field + pub fn take_rfc3161_timestamps(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.rfc3161_timestamps, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for TimestampVerificationData { + fn is_initialized(&self) -> bool { + for v in &self.rfc3161_timestamps { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.rfc3161_timestamps)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.rfc3161_timestamps { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + for v in &self.rfc3161_timestamps { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TimestampVerificationData { + TimestampVerificationData::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "rfc3161_timestamps", + |m: &TimestampVerificationData| { &m.rfc3161_timestamps }, + |m: &mut TimestampVerificationData| { &mut m.rfc3161_timestamps }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "TimestampVerificationData", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static TimestampVerificationData { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(TimestampVerificationData::new) + } +} + +impl ::protobuf::Clear for TimestampVerificationData { + fn clear(&mut self) { + self.rfc3161_timestamps.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TimestampVerificationData { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TimestampVerificationData { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct VerificationMaterial { + // message fields + pub tlog_entries: ::protobuf::RepeatedField, + pub timestamp_verification_data: ::protobuf::SingularPtrField, + // message oneof groups + pub content: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a VerificationMaterial { + fn default() -> &'a VerificationMaterial { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum VerificationMaterial_oneof_content { + public_key(super::sigstore_common::PublicKeyIdentifier), + x509_certificate_chain(super::sigstore_common::X509CertificateChain), +} + +impl VerificationMaterial { + pub fn new() -> VerificationMaterial { + ::std::default::Default::default() + } + + // .dev.sigstore.common.v1.PublicKeyIdentifier public_key = 1; + + + pub fn get_public_key(&self) -> &super::sigstore_common::PublicKeyIdentifier { + match self.content { + ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_public_key(&mut self) { + self.content = ::std::option::Option::None; + } + + pub fn has_public_key(&self) -> bool { + match self.content { + ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: super::sigstore_common::PublicKeyIdentifier) { + self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(v)) + } + + // Mutable pointer to the field. + pub fn mut_public_key(&mut self) -> &mut super::sigstore_common::PublicKeyIdentifier { + if let ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(_)) = self.content { + } else { + self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(super::sigstore_common::PublicKeyIdentifier::new())); + } + match self.content { + ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_public_key(&mut self) -> super::sigstore_common::PublicKeyIdentifier { + if self.has_public_key() { + match self.content.take() { + ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(v)) => v, + _ => panic!(), + } + } else { + super::sigstore_common::PublicKeyIdentifier::new() + } + } + + // .dev.sigstore.common.v1.X509CertificateChain x509_certificate_chain = 2; + + + pub fn get_x509_certificate_chain(&self) -> &super::sigstore_common::X509CertificateChain { + match self.content { + ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_x509_certificate_chain(&mut self) { + self.content = ::std::option::Option::None; + } + + pub fn has_x509_certificate_chain(&self) -> bool { + match self.content { + ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_x509_certificate_chain(&mut self, v: super::sigstore_common::X509CertificateChain) { + self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(v)) + } + + // Mutable pointer to the field. + pub fn mut_x509_certificate_chain(&mut self) -> &mut super::sigstore_common::X509CertificateChain { + if let ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(_)) = self.content { + } else { + self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(super::sigstore_common::X509CertificateChain::new())); + } + match self.content { + ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_x509_certificate_chain(&mut self) -> super::sigstore_common::X509CertificateChain { + if self.has_x509_certificate_chain() { + match self.content.take() { + ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(v)) => v, + _ => panic!(), + } + } else { + super::sigstore_common::X509CertificateChain::new() + } + } + + // repeated .dev.sigstore.rekor.v1.TransparencyLogEntry tlog_entries = 3; + + + pub fn get_tlog_entries(&self) -> &[super::sigstore_rekor::TransparencyLogEntry] { + &self.tlog_entries + } + pub fn clear_tlog_entries(&mut self) { + self.tlog_entries.clear(); + } + + // Param is passed by value, moved + pub fn set_tlog_entries(&mut self, v: ::protobuf::RepeatedField) { + self.tlog_entries = v; + } + + // Mutable pointer to the field. + pub fn mut_tlog_entries(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.tlog_entries + } + + // Take field + pub fn take_tlog_entries(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.tlog_entries, ::protobuf::RepeatedField::new()) + } + + // .dev.sigstore.bundle.v1.TimestampVerificationData timestamp_verification_data = 4; + + + pub fn get_timestamp_verification_data(&self) -> &TimestampVerificationData { + self.timestamp_verification_data.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_timestamp_verification_data(&mut self) { + self.timestamp_verification_data.clear(); + } + + pub fn has_timestamp_verification_data(&self) -> bool { + self.timestamp_verification_data.is_some() + } + + // Param is passed by value, moved + pub fn set_timestamp_verification_data(&mut self, v: TimestampVerificationData) { + self.timestamp_verification_data = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_timestamp_verification_data(&mut self) -> &mut TimestampVerificationData { + if self.timestamp_verification_data.is_none() { + self.timestamp_verification_data.set_default(); + } + self.timestamp_verification_data.as_mut().unwrap() + } + + // Take field + pub fn take_timestamp_verification_data(&mut self) -> TimestampVerificationData { + self.timestamp_verification_data.take().unwrap_or_else(|| TimestampVerificationData::new()) + } +} + +impl ::protobuf::Message for VerificationMaterial { + fn is_initialized(&self) -> bool { + if let Some(VerificationMaterial_oneof_content::public_key(ref v)) = self.content { + if !v.is_initialized() { + return false; + } + } + if let Some(VerificationMaterial_oneof_content::x509_certificate_chain(ref v)) = self.content { + if !v.is_initialized() { + return false; + } + } + for v in &self.tlog_entries { + if !v.is_initialized() { + return false; + } + }; + for v in &self.timestamp_verification_data { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::public_key(is.read_message()?)); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.content = ::std::option::Option::Some(VerificationMaterial_oneof_content::x509_certificate_chain(is.read_message()?)); + }, + 3 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.tlog_entries)?; + }, + 4 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.timestamp_verification_data)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.tlog_entries { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + if let Some(ref v) = self.timestamp_verification_data.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let ::std::option::Option::Some(ref v) = self.content { + match v { + &VerificationMaterial_oneof_content::public_key(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + &VerificationMaterial_oneof_content::x509_certificate_chain(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + for v in &self.tlog_entries { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + if let Some(ref v) = self.timestamp_verification_data.as_ref() { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let ::std::option::Option::Some(ref v) = self.content { + match v { + &VerificationMaterial_oneof_content::public_key(ref v) => { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + &VerificationMaterial_oneof_content::x509_certificate_chain(ref v) => { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> VerificationMaterial { + VerificationMaterial::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::sigstore_common::PublicKeyIdentifier>( + "public_key", + VerificationMaterial::has_public_key, + VerificationMaterial::get_public_key, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::sigstore_common::X509CertificateChain>( + "x509_certificate_chain", + VerificationMaterial::has_x509_certificate_chain, + VerificationMaterial::get_x509_certificate_chain, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "tlog_entries", + |m: &VerificationMaterial| { &m.tlog_entries }, + |m: &mut VerificationMaterial| { &mut m.tlog_entries }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "timestamp_verification_data", + |m: &VerificationMaterial| { &m.timestamp_verification_data }, + |m: &mut VerificationMaterial| { &mut m.timestamp_verification_data }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "VerificationMaterial", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static VerificationMaterial { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(VerificationMaterial::new) + } +} + +impl ::protobuf::Clear for VerificationMaterial { + fn clear(&mut self) { + self.content = ::std::option::Option::None; + self.content = ::std::option::Option::None; + self.tlog_entries.clear(); + self.timestamp_verification_data.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for VerificationMaterial { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for VerificationMaterial { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Bundle { + // message fields + pub media_type: ::std::string::String, + pub verification_material: ::protobuf::SingularPtrField, + // message oneof groups + pub content: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Bundle { + fn default() -> &'a Bundle { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum Bundle_oneof_content { + message_signature(super::sigstore_common::MessageSignature), + dsse_envelope(super::envelope::Envelope), +} + +impl Bundle { + pub fn new() -> Bundle { + ::std::default::Default::default() + } + + // string media_type = 1; + + + pub fn get_media_type(&self) -> &str { + &self.media_type + } + pub fn clear_media_type(&mut self) { + self.media_type.clear(); + } + + // Param is passed by value, moved + pub fn set_media_type(&mut self, v: ::std::string::String) { + self.media_type = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_media_type(&mut self) -> &mut ::std::string::String { + &mut self.media_type + } + + // Take field + pub fn take_media_type(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.media_type, ::std::string::String::new()) + } + + // .dev.sigstore.bundle.v1.VerificationMaterial verification_material = 2; + + + pub fn get_verification_material(&self) -> &VerificationMaterial { + self.verification_material.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_verification_material(&mut self) { + self.verification_material.clear(); + } + + pub fn has_verification_material(&self) -> bool { + self.verification_material.is_some() + } + + // Param is passed by value, moved + pub fn set_verification_material(&mut self, v: VerificationMaterial) { + self.verification_material = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_verification_material(&mut self) -> &mut VerificationMaterial { + if self.verification_material.is_none() { + self.verification_material.set_default(); + } + self.verification_material.as_mut().unwrap() + } + + // Take field + pub fn take_verification_material(&mut self) -> VerificationMaterial { + self.verification_material.take().unwrap_or_else(|| VerificationMaterial::new()) + } + + // .dev.sigstore.common.v1.MessageSignature message_signature = 3; + + + pub fn get_message_signature(&self) -> &super::sigstore_common::MessageSignature { + match self.content { + ::std::option::Option::Some(Bundle_oneof_content::message_signature(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_message_signature(&mut self) { + self.content = ::std::option::Option::None; + } + + pub fn has_message_signature(&self) -> bool { + match self.content { + ::std::option::Option::Some(Bundle_oneof_content::message_signature(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_message_signature(&mut self, v: super::sigstore_common::MessageSignature) { + self.content = ::std::option::Option::Some(Bundle_oneof_content::message_signature(v)) + } + + // Mutable pointer to the field. + pub fn mut_message_signature(&mut self) -> &mut super::sigstore_common::MessageSignature { + if let ::std::option::Option::Some(Bundle_oneof_content::message_signature(_)) = self.content { + } else { + self.content = ::std::option::Option::Some(Bundle_oneof_content::message_signature(super::sigstore_common::MessageSignature::new())); + } + match self.content { + ::std::option::Option::Some(Bundle_oneof_content::message_signature(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_message_signature(&mut self) -> super::sigstore_common::MessageSignature { + if self.has_message_signature() { + match self.content.take() { + ::std::option::Option::Some(Bundle_oneof_content::message_signature(v)) => v, + _ => panic!(), + } + } else { + super::sigstore_common::MessageSignature::new() + } + } + + // .io.intoto.Envelope dsse_envelope = 4; + + + pub fn get_dsse_envelope(&self) -> &super::envelope::Envelope { + match self.content { + ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_dsse_envelope(&mut self) { + self.content = ::std::option::Option::None; + } + + pub fn has_dsse_envelope(&self) -> bool { + match self.content { + ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_dsse_envelope(&mut self, v: super::envelope::Envelope) { + self.content = ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(v)) + } + + // Mutable pointer to the field. + pub fn mut_dsse_envelope(&mut self) -> &mut super::envelope::Envelope { + if let ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(_)) = self.content { + } else { + self.content = ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(super::envelope::Envelope::new())); + } + match self.content { + ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_dsse_envelope(&mut self) -> super::envelope::Envelope { + if self.has_dsse_envelope() { + match self.content.take() { + ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(v)) => v, + _ => panic!(), + } + } else { + super::envelope::Envelope::new() + } + } +} + +impl ::protobuf::Message for Bundle { + fn is_initialized(&self) -> bool { + for v in &self.verification_material { + if !v.is_initialized() { + return false; + } + }; + if let Some(Bundle_oneof_content::message_signature(ref v)) = self.content { + if !v.is_initialized() { + return false; + } + } + if let Some(Bundle_oneof_content::dsse_envelope(ref v)) = self.content { + if !v.is_initialized() { + return false; + } + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.media_type)?; + }, + 2 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.verification_material)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.content = ::std::option::Option::Some(Bundle_oneof_content::message_signature(is.read_message()?)); + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.content = ::std::option::Option::Some(Bundle_oneof_content::dsse_envelope(is.read_message()?)); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.media_type.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.media_type); + } + if let Some(ref v) = self.verification_material.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let ::std::option::Option::Some(ref v) = self.content { + match v { + &Bundle_oneof_content::message_signature(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + &Bundle_oneof_content::dsse_envelope(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.media_type.is_empty() { + os.write_string(1, &self.media_type)?; + } + if let Some(ref v) = self.verification_material.as_ref() { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let ::std::option::Option::Some(ref v) = self.content { + match v { + &Bundle_oneof_content::message_signature(ref v) => { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + &Bundle_oneof_content::dsse_envelope(ref v) => { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Bundle { + Bundle::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "media_type", + |m: &Bundle| { &m.media_type }, + |m: &mut Bundle| { &mut m.media_type }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "verification_material", + |m: &Bundle| { &m.verification_material }, + |m: &mut Bundle| { &mut m.verification_material }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::sigstore_common::MessageSignature>( + "message_signature", + Bundle::has_message_signature, + Bundle::get_message_signature, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, super::envelope::Envelope>( + "dsse_envelope", + Bundle::has_dsse_envelope, + Bundle::get_dsse_envelope, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "Bundle", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static Bundle { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(Bundle::new) + } +} + +impl ::protobuf::Clear for Bundle { + fn clear(&mut self) { + self.media_type.clear(); + self.verification_material.clear(); + self.content = ::std::option::Option::None; + self.content = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Bundle { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Bundle { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15sigstore_bundle.proto\x12\x16dev.sigstore.bundle.v1\x1a\x1fgoogle/\ + api/field_behavior.proto\x1a\x0eenvelope.proto\x1a\x15sigstore_common.pr\ + oto\x1a\x14sigstore_rekor.proto\"z\n\x19TimestampVerificationData\x12]\n\ + \x12rfc3161_timestamps\x18\x01\x20\x03(\x0b2..dev.sigstore.common.v1.RFC\ + 3161SignedTimestampR\x11rfc3161Timestamps\"\xa2\x03\n\x14VerificationMat\ + erial\x12Q\n\npublic_key\x18\x01\x20\x01(\x0b2+.dev.sigstore.common.v1.P\ + ublicKeyIdentifierH\0R\tpublicKeyB\x03\xe0A\x02\x12i\n\x16x509_certifica\ + te_chain\x18\x02\x20\x01(\x0b2,.dev.sigstore.common.v1.X509CertificateCh\ + ainH\0R\x14x509CertificateChainB\x03\xe0A\x02\x12N\n\x0ctlog_entries\x18\ + \x03\x20\x03(\x0b2+.dev.sigstore.rekor.v1.TransparencyLogEntryR\x0btlogE\ + ntries\x12q\n\x1btimestamp_verification_data\x18\x04\x20\x01(\x0b21.dev.\ + sigstore.bundle.v1.TimestampVerificationDataR\x19timestampVerificationDa\ + taB\t\n\x07content\"\xbf\x02\n\x06Bundle\x12\x1d\n\nmedia_type\x18\x01\ + \x20\x01(\tR\tmediaType\x12f\n\x15verification_material\x18\x02\x20\x01(\ + \x0b2,.dev.sigstore.bundle.v1.VerificationMaterialR\x14verificationMater\ + ialB\x03\xe0A\x02\x12\\\n\x11message_signature\x18\x03\x20\x01(\x0b2(.de\ + v.sigstore.common.v1.MessageSignatureH\0R\x10messageSignatureB\x03\xe0A\ + \x02\x12?\n\rdsse_envelope\x18\x04\x20\x01(\x0b2\x13.io.intoto.EnvelopeH\ + \0R\x0cdsseEnvelopeB\x03\xe0A\x02B\t\n\x07contentJ\x04\x08\x05\x103Be\n\ + \x1cdev.sigstore.proto.bundle.v1B\x0bBundleProtoP\x01Z6github.com/sigsto\ + re/protobuf-specs/gen/pb-go/bundle/v1b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/gen/pb-rust/src/sigstore_common.rs b/gen/pb-rust/src/sigstore_common.rs new file mode 100644 index 00000000..ab8e507e --- /dev/null +++ b/gen/pb-rust/src/sigstore_common.rs @@ -0,0 +1,2918 @@ +// This file is generated by rust-protobuf 2.28.0. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `sigstore_common.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; + +#[derive(PartialEq,Clone,Default)] +pub struct HashOutput { + // message fields + pub algorithm: HashAlgorithm, + pub digest: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a HashOutput { + fn default() -> &'a HashOutput { + ::default_instance() + } +} + +impl HashOutput { + pub fn new() -> HashOutput { + ::std::default::Default::default() + } + + // .dev.sigstore.common.v1.HashAlgorithm algorithm = 1; + + + pub fn get_algorithm(&self) -> HashAlgorithm { + self.algorithm + } + pub fn clear_algorithm(&mut self) { + self.algorithm = HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED; + } + + // Param is passed by value, moved + pub fn set_algorithm(&mut self, v: HashAlgorithm) { + self.algorithm = v; + } + + // bytes digest = 2; + + + pub fn get_digest(&self) -> &[u8] { + &self.digest + } + pub fn clear_digest(&mut self) { + self.digest.clear(); + } + + // Param is passed by value, moved + pub fn set_digest(&mut self, v: ::std::vec::Vec) { + self.digest = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_digest(&mut self) -> &mut ::std::vec::Vec { + &mut self.digest + } + + // Take field + pub fn take_digest(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.digest, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for HashOutput { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.algorithm, 1, &mut self.unknown_fields)? + }, + 2 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.digest)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.algorithm != HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED { + my_size += ::protobuf::rt::enum_size(1, self.algorithm); + } + if !self.digest.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.digest); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.algorithm != HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED { + os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.algorithm))?; + } + if !self.digest.is_empty() { + os.write_bytes(2, &self.digest)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> HashOutput { + HashOutput::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "algorithm", + |m: &HashOutput| { &m.algorithm }, + |m: &mut HashOutput| { &mut m.algorithm }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "digest", + |m: &HashOutput| { &m.digest }, + |m: &mut HashOutput| { &mut m.digest }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "HashOutput", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static HashOutput { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(HashOutput::new) + } +} + +impl ::protobuf::Clear for HashOutput { + fn clear(&mut self) { + self.algorithm = HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED; + self.digest.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for HashOutput { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for HashOutput { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct MessageSignature { + // message fields + pub message_digest: ::protobuf::SingularPtrField, + pub signature: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a MessageSignature { + fn default() -> &'a MessageSignature { + ::default_instance() + } +} + +impl MessageSignature { + pub fn new() -> MessageSignature { + ::std::default::Default::default() + } + + // .dev.sigstore.common.v1.HashOutput message_digest = 1; + + + pub fn get_message_digest(&self) -> &HashOutput { + self.message_digest.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_message_digest(&mut self) { + self.message_digest.clear(); + } + + pub fn has_message_digest(&self) -> bool { + self.message_digest.is_some() + } + + // Param is passed by value, moved + pub fn set_message_digest(&mut self, v: HashOutput) { + self.message_digest = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_message_digest(&mut self) -> &mut HashOutput { + if self.message_digest.is_none() { + self.message_digest.set_default(); + } + self.message_digest.as_mut().unwrap() + } + + // Take field + pub fn take_message_digest(&mut self) -> HashOutput { + self.message_digest.take().unwrap_or_else(|| HashOutput::new()) + } + + // bytes signature = 2; + + + pub fn get_signature(&self) -> &[u8] { + &self.signature + } + pub fn clear_signature(&mut self) { + self.signature.clear(); + } + + // Param is passed by value, moved + pub fn set_signature(&mut self, v: ::std::vec::Vec) { + self.signature = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signature(&mut self) -> &mut ::std::vec::Vec { + &mut self.signature + } + + // Take field + pub fn take_signature(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.signature, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for MessageSignature { + fn is_initialized(&self) -> bool { + for v in &self.message_digest { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.message_digest)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.signature)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.message_digest.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if !self.signature.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.signature); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.message_digest.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if !self.signature.is_empty() { + os.write_bytes(2, &self.signature)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> MessageSignature { + MessageSignature::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "message_digest", + |m: &MessageSignature| { &m.message_digest }, + |m: &mut MessageSignature| { &mut m.message_digest }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signature", + |m: &MessageSignature| { &m.signature }, + |m: &mut MessageSignature| { &mut m.signature }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "MessageSignature", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static MessageSignature { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(MessageSignature::new) + } +} + +impl ::protobuf::Clear for MessageSignature { + fn clear(&mut self) { + self.message_digest.clear(); + self.signature.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for MessageSignature { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for MessageSignature { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct LogId { + // message fields + pub key_id: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a LogId { + fn default() -> &'a LogId { + ::default_instance() + } +} + +impl LogId { + pub fn new() -> LogId { + ::std::default::Default::default() + } + + // bytes key_id = 1; + + + pub fn get_key_id(&self) -> &[u8] { + &self.key_id + } + pub fn clear_key_id(&mut self) { + self.key_id.clear(); + } + + // Param is passed by value, moved + pub fn set_key_id(&mut self, v: ::std::vec::Vec) { + self.key_id = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_key_id(&mut self) -> &mut ::std::vec::Vec { + &mut self.key_id + } + + // Take field + pub fn take_key_id(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.key_id, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for LogId { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.key_id)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.key_id.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.key_id); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.key_id.is_empty() { + os.write_bytes(1, &self.key_id)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> LogId { + LogId::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "key_id", + |m: &LogId| { &m.key_id }, + |m: &mut LogId| { &mut m.key_id }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "LogId", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static LogId { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(LogId::new) + } +} + +impl ::protobuf::Clear for LogId { + fn clear(&mut self) { + self.key_id.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for LogId { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for LogId { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct RFC3161SignedTimestamp { + // message fields + pub signed_timestamp: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a RFC3161SignedTimestamp { + fn default() -> &'a RFC3161SignedTimestamp { + ::default_instance() + } +} + +impl RFC3161SignedTimestamp { + pub fn new() -> RFC3161SignedTimestamp { + ::std::default::Default::default() + } + + // bytes signed_timestamp = 1; + + + pub fn get_signed_timestamp(&self) -> &[u8] { + &self.signed_timestamp + } + pub fn clear_signed_timestamp(&mut self) { + self.signed_timestamp.clear(); + } + + // Param is passed by value, moved + pub fn set_signed_timestamp(&mut self, v: ::std::vec::Vec) { + self.signed_timestamp = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signed_timestamp(&mut self) -> &mut ::std::vec::Vec { + &mut self.signed_timestamp + } + + // Take field + pub fn take_signed_timestamp(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.signed_timestamp, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for RFC3161SignedTimestamp { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.signed_timestamp)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.signed_timestamp.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.signed_timestamp); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.signed_timestamp.is_empty() { + os.write_bytes(1, &self.signed_timestamp)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> RFC3161SignedTimestamp { + RFC3161SignedTimestamp::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signed_timestamp", + |m: &RFC3161SignedTimestamp| { &m.signed_timestamp }, + |m: &mut RFC3161SignedTimestamp| { &mut m.signed_timestamp }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "RFC3161SignedTimestamp", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static RFC3161SignedTimestamp { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(RFC3161SignedTimestamp::new) + } +} + +impl ::protobuf::Clear for RFC3161SignedTimestamp { + fn clear(&mut self) { + self.signed_timestamp.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for RFC3161SignedTimestamp { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for RFC3161SignedTimestamp { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PublicKey { + // message fields + pub key_details: PublicKeyDetails, + // message oneof groups + pub _raw_bytes: ::std::option::Option, + pub _valid_for: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a PublicKey { + fn default() -> &'a PublicKey { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum PublicKey_oneof__raw_bytes { + raw_bytes(::std::vec::Vec), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum PublicKey_oneof__valid_for { + valid_for(TimeRange), +} + +impl PublicKey { + pub fn new() -> PublicKey { + ::std::default::Default::default() + } + + // bytes raw_bytes = 1; + + + pub fn get_raw_bytes(&self) -> &[u8] { + match self._raw_bytes { + ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(ref v)) => v, + _ => &[], + } + } + pub fn clear_raw_bytes(&mut self) { + self._raw_bytes = ::std::option::Option::None; + } + + pub fn has_raw_bytes(&self) -> bool { + match self._raw_bytes { + ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_raw_bytes(&mut self, v: ::std::vec::Vec) { + self._raw_bytes = ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(v)) + } + + // Mutable pointer to the field. + pub fn mut_raw_bytes(&mut self) -> &mut ::std::vec::Vec { + if let ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(_)) = self._raw_bytes { + } else { + self._raw_bytes = ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(::std::vec::Vec::new())); + } + match self._raw_bytes { + ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_raw_bytes(&mut self) -> ::std::vec::Vec { + if self.has_raw_bytes() { + match self._raw_bytes.take() { + ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(v)) => v, + _ => panic!(), + } + } else { + ::std::vec::Vec::new() + } + } + + // .dev.sigstore.common.v1.PublicKeyDetails key_details = 2; + + + pub fn get_key_details(&self) -> PublicKeyDetails { + self.key_details + } + pub fn clear_key_details(&mut self) { + self.key_details = PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED; + } + + // Param is passed by value, moved + pub fn set_key_details(&mut self, v: PublicKeyDetails) { + self.key_details = v; + } + + // .dev.sigstore.common.v1.TimeRange valid_for = 3; + + + pub fn get_valid_for(&self) -> &TimeRange { + match self._valid_for { + ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_valid_for(&mut self) { + self._valid_for = ::std::option::Option::None; + } + + pub fn has_valid_for(&self) -> bool { + match self._valid_for { + ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_valid_for(&mut self, v: TimeRange) { + self._valid_for = ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(v)) + } + + // Mutable pointer to the field. + pub fn mut_valid_for(&mut self) -> &mut TimeRange { + if let ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(_)) = self._valid_for { + } else { + self._valid_for = ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(TimeRange::new())); + } + match self._valid_for { + ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_valid_for(&mut self) -> TimeRange { + if self.has_valid_for() { + match self._valid_for.take() { + ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(v)) => v, + _ => panic!(), + } + } else { + TimeRange::new() + } + } +} + +impl ::protobuf::Message for PublicKey { + fn is_initialized(&self) -> bool { + if let Some(PublicKey_oneof__valid_for::valid_for(ref v)) = self._valid_for { + if !v.is_initialized() { + return false; + } + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self._raw_bytes = ::std::option::Option::Some(PublicKey_oneof__raw_bytes::raw_bytes(is.read_bytes()?)); + }, + 2 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.key_details, 2, &mut self.unknown_fields)? + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self._valid_for = ::std::option::Option::Some(PublicKey_oneof__valid_for::valid_for(is.read_message()?)); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.key_details != PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED { + my_size += ::protobuf::rt::enum_size(2, self.key_details); + } + if let ::std::option::Option::Some(ref v) = self._raw_bytes { + match v { + &PublicKey_oneof__raw_bytes::raw_bytes(ref v) => { + my_size += ::protobuf::rt::bytes_size(1, &v); + }, + }; + } + if let ::std::option::Option::Some(ref v) = self._valid_for { + match v { + &PublicKey_oneof__valid_for::valid_for(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.key_details != PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED { + os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.key_details))?; + } + if let ::std::option::Option::Some(ref v) = self._raw_bytes { + match v { + &PublicKey_oneof__raw_bytes::raw_bytes(ref v) => { + os.write_bytes(1, v)?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self._valid_for { + match v { + &PublicKey_oneof__valid_for::valid_for(ref v) => { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PublicKey { + PublicKey::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor::<_>( + "raw_bytes", + PublicKey::has_raw_bytes, + PublicKey::get_raw_bytes, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "key_details", + |m: &PublicKey| { &m.key_details }, + |m: &mut PublicKey| { &mut m.key_details }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, TimeRange>( + "valid_for", + PublicKey::has_valid_for, + PublicKey::get_valid_for, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "PublicKey", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static PublicKey { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(PublicKey::new) + } +} + +impl ::protobuf::Clear for PublicKey { + fn clear(&mut self) { + self._raw_bytes = ::std::option::Option::None; + self.key_details = PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED; + self._valid_for = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PublicKey { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PublicKey { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PublicKeyIdentifier { + // message fields + pub hint: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a PublicKeyIdentifier { + fn default() -> &'a PublicKeyIdentifier { + ::default_instance() + } +} + +impl PublicKeyIdentifier { + pub fn new() -> PublicKeyIdentifier { + ::std::default::Default::default() + } + + // string hint = 1; + + + pub fn get_hint(&self) -> &str { + &self.hint + } + pub fn clear_hint(&mut self) { + self.hint.clear(); + } + + // Param is passed by value, moved + pub fn set_hint(&mut self, v: ::std::string::String) { + self.hint = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_hint(&mut self) -> &mut ::std::string::String { + &mut self.hint + } + + // Take field + pub fn take_hint(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.hint, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for PublicKeyIdentifier { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.hint)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.hint.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.hint); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.hint.is_empty() { + os.write_string(1, &self.hint)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PublicKeyIdentifier { + PublicKeyIdentifier::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "hint", + |m: &PublicKeyIdentifier| { &m.hint }, + |m: &mut PublicKeyIdentifier| { &mut m.hint }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "PublicKeyIdentifier", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static PublicKeyIdentifier { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(PublicKeyIdentifier::new) + } +} + +impl ::protobuf::Clear for PublicKeyIdentifier { + fn clear(&mut self) { + self.hint.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PublicKeyIdentifier { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PublicKeyIdentifier { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ObjectIdentifier { + // message fields + pub id: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ObjectIdentifier { + fn default() -> &'a ObjectIdentifier { + ::default_instance() + } +} + +impl ObjectIdentifier { + pub fn new() -> ObjectIdentifier { + ::std::default::Default::default() + } + + // repeated int32 id = 1; + + + pub fn get_id(&self) -> &[i32] { + &self.id + } + pub fn clear_id(&mut self) { + self.id.clear(); + } + + // Param is passed by value, moved + pub fn set_id(&mut self, v: ::std::vec::Vec) { + self.id = v; + } + + // Mutable pointer to the field. + pub fn mut_id(&mut self) -> &mut ::std::vec::Vec { + &mut self.id + } + + // Take field + pub fn take_id(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.id, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for ObjectIdentifier { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_int32_into(wire_type, is, &mut self.id)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.id { + my_size += ::protobuf::rt::value_size(1, *value, ::protobuf::wire_format::WireTypeVarint); + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + for v in &self.id { + os.write_int32(1, *v)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ObjectIdentifier { + ObjectIdentifier::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_vec_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "id", + |m: &ObjectIdentifier| { &m.id }, + |m: &mut ObjectIdentifier| { &mut m.id }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "ObjectIdentifier", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ObjectIdentifier { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(ObjectIdentifier::new) + } +} + +impl ::protobuf::Clear for ObjectIdentifier { + fn clear(&mut self) { + self.id.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ObjectIdentifier { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ObjectIdentifier { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ObjectIdentifierValuePair { + // message fields + pub oid: ::protobuf::SingularPtrField, + pub value: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ObjectIdentifierValuePair { + fn default() -> &'a ObjectIdentifierValuePair { + ::default_instance() + } +} + +impl ObjectIdentifierValuePair { + pub fn new() -> ObjectIdentifierValuePair { + ::std::default::Default::default() + } + + // .dev.sigstore.common.v1.ObjectIdentifier oid = 1; + + + pub fn get_oid(&self) -> &ObjectIdentifier { + self.oid.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_oid(&mut self) { + self.oid.clear(); + } + + pub fn has_oid(&self) -> bool { + self.oid.is_some() + } + + // Param is passed by value, moved + pub fn set_oid(&mut self, v: ObjectIdentifier) { + self.oid = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_oid(&mut self) -> &mut ObjectIdentifier { + if self.oid.is_none() { + self.oid.set_default(); + } + self.oid.as_mut().unwrap() + } + + // Take field + pub fn take_oid(&mut self) -> ObjectIdentifier { + self.oid.take().unwrap_or_else(|| ObjectIdentifier::new()) + } + + // bytes value = 2; + + + pub fn get_value(&self) -> &[u8] { + &self.value + } + pub fn clear_value(&mut self) { + self.value.clear(); + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::vec::Vec) { + self.value = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_value(&mut self) -> &mut ::std::vec::Vec { + &mut self.value + } + + // Take field + pub fn take_value(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.value, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for ObjectIdentifierValuePair { + fn is_initialized(&self) -> bool { + for v in &self.oid { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.oid)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.value)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.oid.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if !self.value.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.value); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.oid.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if !self.value.is_empty() { + os.write_bytes(2, &self.value)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ObjectIdentifierValuePair { + ObjectIdentifierValuePair::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "oid", + |m: &ObjectIdentifierValuePair| { &m.oid }, + |m: &mut ObjectIdentifierValuePair| { &mut m.oid }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "value", + |m: &ObjectIdentifierValuePair| { &m.value }, + |m: &mut ObjectIdentifierValuePair| { &mut m.value }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "ObjectIdentifierValuePair", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ObjectIdentifierValuePair { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(ObjectIdentifierValuePair::new) + } +} + +impl ::protobuf::Clear for ObjectIdentifierValuePair { + fn clear(&mut self) { + self.oid.clear(); + self.value.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ObjectIdentifierValuePair { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ObjectIdentifierValuePair { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct DistinguishedName { + // message fields + pub organization: ::std::string::String, + pub common_name: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a DistinguishedName { + fn default() -> &'a DistinguishedName { + ::default_instance() + } +} + +impl DistinguishedName { + pub fn new() -> DistinguishedName { + ::std::default::Default::default() + } + + // string organization = 1; + + + pub fn get_organization(&self) -> &str { + &self.organization + } + pub fn clear_organization(&mut self) { + self.organization.clear(); + } + + // Param is passed by value, moved + pub fn set_organization(&mut self, v: ::std::string::String) { + self.organization = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_organization(&mut self) -> &mut ::std::string::String { + &mut self.organization + } + + // Take field + pub fn take_organization(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.organization, ::std::string::String::new()) + } + + // string common_name = 2; + + + pub fn get_common_name(&self) -> &str { + &self.common_name + } + pub fn clear_common_name(&mut self) { + self.common_name.clear(); + } + + // Param is passed by value, moved + pub fn set_common_name(&mut self, v: ::std::string::String) { + self.common_name = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_common_name(&mut self) -> &mut ::std::string::String { + &mut self.common_name + } + + // Take field + pub fn take_common_name(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.common_name, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for DistinguishedName { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.organization)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.common_name)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.organization.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.organization); + } + if !self.common_name.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.common_name); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.organization.is_empty() { + os.write_string(1, &self.organization)?; + } + if !self.common_name.is_empty() { + os.write_string(2, &self.common_name)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> DistinguishedName { + DistinguishedName::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "organization", + |m: &DistinguishedName| { &m.organization }, + |m: &mut DistinguishedName| { &mut m.organization }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "common_name", + |m: &DistinguishedName| { &m.common_name }, + |m: &mut DistinguishedName| { &mut m.common_name }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "DistinguishedName", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static DistinguishedName { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(DistinguishedName::new) + } +} + +impl ::protobuf::Clear for DistinguishedName { + fn clear(&mut self) { + self.organization.clear(); + self.common_name.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for DistinguishedName { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for DistinguishedName { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct X509Certificate { + // message fields + pub raw_bytes: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a X509Certificate { + fn default() -> &'a X509Certificate { + ::default_instance() + } +} + +impl X509Certificate { + pub fn new() -> X509Certificate { + ::std::default::Default::default() + } + + // bytes raw_bytes = 1; + + + pub fn get_raw_bytes(&self) -> &[u8] { + &self.raw_bytes + } + pub fn clear_raw_bytes(&mut self) { + self.raw_bytes.clear(); + } + + // Param is passed by value, moved + pub fn set_raw_bytes(&mut self, v: ::std::vec::Vec) { + self.raw_bytes = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_raw_bytes(&mut self) -> &mut ::std::vec::Vec { + &mut self.raw_bytes + } + + // Take field + pub fn take_raw_bytes(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.raw_bytes, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for X509Certificate { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.raw_bytes)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.raw_bytes.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.raw_bytes); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.raw_bytes.is_empty() { + os.write_bytes(1, &self.raw_bytes)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> X509Certificate { + X509Certificate::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "raw_bytes", + |m: &X509Certificate| { &m.raw_bytes }, + |m: &mut X509Certificate| { &mut m.raw_bytes }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "X509Certificate", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static X509Certificate { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(X509Certificate::new) + } +} + +impl ::protobuf::Clear for X509Certificate { + fn clear(&mut self) { + self.raw_bytes.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for X509Certificate { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for X509Certificate { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct SubjectAlternativeName { + // message fields + pub field_type: SubjectAlternativeNameType, + // message oneof groups + pub identity: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a SubjectAlternativeName { + fn default() -> &'a SubjectAlternativeName { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum SubjectAlternativeName_oneof_identity { + regexp(::std::string::String), + value(::std::string::String), +} + +impl SubjectAlternativeName { + pub fn new() -> SubjectAlternativeName { + ::std::default::Default::default() + } + + // .dev.sigstore.common.v1.SubjectAlternativeNameType type = 1; + + + pub fn get_field_type(&self) -> SubjectAlternativeNameType { + self.field_type + } + pub fn clear_field_type(&mut self) { + self.field_type = SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED; + } + + // Param is passed by value, moved + pub fn set_field_type(&mut self, v: SubjectAlternativeNameType) { + self.field_type = v; + } + + // string regexp = 2; + + + pub fn get_regexp(&self) -> &str { + match self.identity { + ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(ref v)) => v, + _ => "", + } + } + pub fn clear_regexp(&mut self) { + self.identity = ::std::option::Option::None; + } + + pub fn has_regexp(&self) -> bool { + match self.identity { + ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_regexp(&mut self, v: ::std::string::String) { + self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(v)) + } + + // Mutable pointer to the field. + pub fn mut_regexp(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(_)) = self.identity { + } else { + self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(::std::string::String::new())); + } + match self.identity { + ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_regexp(&mut self) -> ::std::string::String { + if self.has_regexp() { + match self.identity.take() { + ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } + + // string value = 3; + + + pub fn get_value(&self) -> &str { + match self.identity { + ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(ref v)) => v, + _ => "", + } + } + pub fn clear_value(&mut self) { + self.identity = ::std::option::Option::None; + } + + pub fn has_value(&self) -> bool { + match self.identity { + ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_value(&mut self, v: ::std::string::String) { + self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(v)) + } + + // Mutable pointer to the field. + pub fn mut_value(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(_)) = self.identity { + } else { + self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(::std::string::String::new())); + } + match self.identity { + ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_value(&mut self) -> ::std::string::String { + if self.has_value() { + match self.identity.take() { + ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } +} + +impl ::protobuf::Message for SubjectAlternativeName { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.field_type, 1, &mut self.unknown_fields)? + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::regexp(is.read_string()?)); + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.identity = ::std::option::Option::Some(SubjectAlternativeName_oneof_identity::value(is.read_string()?)); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.field_type != SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED { + my_size += ::protobuf::rt::enum_size(1, self.field_type); + } + if let ::std::option::Option::Some(ref v) = self.identity { + match v { + &SubjectAlternativeName_oneof_identity::regexp(ref v) => { + my_size += ::protobuf::rt::string_size(2, &v); + }, + &SubjectAlternativeName_oneof_identity::value(ref v) => { + my_size += ::protobuf::rt::string_size(3, &v); + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.field_type != SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED { + os.write_enum(1, ::protobuf::ProtobufEnum::value(&self.field_type))?; + } + if let ::std::option::Option::Some(ref v) = self.identity { + match v { + &SubjectAlternativeName_oneof_identity::regexp(ref v) => { + os.write_string(2, v)?; + }, + &SubjectAlternativeName_oneof_identity::value(ref v) => { + os.write_string(3, v)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> SubjectAlternativeName { + SubjectAlternativeName::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "type", + |m: &SubjectAlternativeName| { &m.field_type }, + |m: &mut SubjectAlternativeName| { &mut m.field_type }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( + "regexp", + SubjectAlternativeName::has_regexp, + SubjectAlternativeName::get_regexp, + )); + fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( + "value", + SubjectAlternativeName::has_value, + SubjectAlternativeName::get_value, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "SubjectAlternativeName", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static SubjectAlternativeName { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(SubjectAlternativeName::new) + } +} + +impl ::protobuf::Clear for SubjectAlternativeName { + fn clear(&mut self) { + self.field_type = SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED; + self.identity = ::std::option::Option::None; + self.identity = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for SubjectAlternativeName { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for SubjectAlternativeName { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct X509CertificateChain { + // message fields + pub certificates: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a X509CertificateChain { + fn default() -> &'a X509CertificateChain { + ::default_instance() + } +} + +impl X509CertificateChain { + pub fn new() -> X509CertificateChain { + ::std::default::Default::default() + } + + // repeated .dev.sigstore.common.v1.X509Certificate certificates = 1; + + + pub fn get_certificates(&self) -> &[X509Certificate] { + &self.certificates + } + pub fn clear_certificates(&mut self) { + self.certificates.clear(); + } + + // Param is passed by value, moved + pub fn set_certificates(&mut self, v: ::protobuf::RepeatedField) { + self.certificates = v; + } + + // Mutable pointer to the field. + pub fn mut_certificates(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.certificates + } + + // Take field + pub fn take_certificates(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.certificates, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for X509CertificateChain { + fn is_initialized(&self) -> bool { + for v in &self.certificates { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.certificates)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.certificates { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + for v in &self.certificates { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> X509CertificateChain { + X509CertificateChain::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "certificates", + |m: &X509CertificateChain| { &m.certificates }, + |m: &mut X509CertificateChain| { &mut m.certificates }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "X509CertificateChain", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static X509CertificateChain { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(X509CertificateChain::new) + } +} + +impl ::protobuf::Clear for X509CertificateChain { + fn clear(&mut self) { + self.certificates.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for X509CertificateChain { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for X509CertificateChain { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TimeRange { + // message fields + pub start: ::protobuf::SingularPtrField<::protobuf::well_known_types::Timestamp>, + // message oneof groups + pub _end: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a TimeRange { + fn default() -> &'a TimeRange { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum TimeRange_oneof__end { + end(::protobuf::well_known_types::Timestamp), +} + +impl TimeRange { + pub fn new() -> TimeRange { + ::std::default::Default::default() + } + + // .google.protobuf.Timestamp start = 1; + + + pub fn get_start(&self) -> &::protobuf::well_known_types::Timestamp { + self.start.as_ref().unwrap_or_else(|| <::protobuf::well_known_types::Timestamp as ::protobuf::Message>::default_instance()) + } + pub fn clear_start(&mut self) { + self.start.clear(); + } + + pub fn has_start(&self) -> bool { + self.start.is_some() + } + + // Param is passed by value, moved + pub fn set_start(&mut self, v: ::protobuf::well_known_types::Timestamp) { + self.start = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_start(&mut self) -> &mut ::protobuf::well_known_types::Timestamp { + if self.start.is_none() { + self.start.set_default(); + } + self.start.as_mut().unwrap() + } + + // Take field + pub fn take_start(&mut self) -> ::protobuf::well_known_types::Timestamp { + self.start.take().unwrap_or_else(|| ::protobuf::well_known_types::Timestamp::new()) + } + + // .google.protobuf.Timestamp end = 2; + + + pub fn get_end(&self) -> &::protobuf::well_known_types::Timestamp { + match self._end { + ::std::option::Option::Some(TimeRange_oneof__end::end(ref v)) => v, + _ => <::protobuf::well_known_types::Timestamp as ::protobuf::Message>::default_instance(), + } + } + pub fn clear_end(&mut self) { + self._end = ::std::option::Option::None; + } + + pub fn has_end(&self) -> bool { + match self._end { + ::std::option::Option::Some(TimeRange_oneof__end::end(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_end(&mut self, v: ::protobuf::well_known_types::Timestamp) { + self._end = ::std::option::Option::Some(TimeRange_oneof__end::end(v)) + } + + // Mutable pointer to the field. + pub fn mut_end(&mut self) -> &mut ::protobuf::well_known_types::Timestamp { + if let ::std::option::Option::Some(TimeRange_oneof__end::end(_)) = self._end { + } else { + self._end = ::std::option::Option::Some(TimeRange_oneof__end::end(::protobuf::well_known_types::Timestamp::new())); + } + match self._end { + ::std::option::Option::Some(TimeRange_oneof__end::end(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_end(&mut self) -> ::protobuf::well_known_types::Timestamp { + if self.has_end() { + match self._end.take() { + ::std::option::Option::Some(TimeRange_oneof__end::end(v)) => v, + _ => panic!(), + } + } else { + ::protobuf::well_known_types::Timestamp::new() + } + } +} + +impl ::protobuf::Message for TimeRange { + fn is_initialized(&self) -> bool { + for v in &self.start { + if !v.is_initialized() { + return false; + } + }; + if let Some(TimeRange_oneof__end::end(ref v)) = self._end { + if !v.is_initialized() { + return false; + } + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.start)?; + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self._end = ::std::option::Option::Some(TimeRange_oneof__end::end(is.read_message()?)); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.start.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let ::std::option::Option::Some(ref v) = self._end { + match v { + &TimeRange_oneof__end::end(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.start.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let ::std::option::Option::Some(ref v) = self._end { + match v { + &TimeRange_oneof__end::end(ref v) => { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TimeRange { + TimeRange::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<::protobuf::well_known_types::Timestamp>>( + "start", + |m: &TimeRange| { &m.start }, + |m: &mut TimeRange| { &mut m.start }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ::protobuf::well_known_types::Timestamp>( + "end", + TimeRange::has_end, + TimeRange::get_end, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "TimeRange", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static TimeRange { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(TimeRange::new) + } +} + +impl ::protobuf::Clear for TimeRange { + fn clear(&mut self) { + self.start.clear(); + self._end = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TimeRange { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TimeRange { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum HashAlgorithm { + HASH_ALGORITHM_UNSPECIFIED = 0, + SHA2_256 = 1, +} + +impl ::protobuf::ProtobufEnum for HashAlgorithm { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED), + 1 => ::std::option::Option::Some(HashAlgorithm::SHA2_256), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [HashAlgorithm] = &[ + HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED, + HashAlgorithm::SHA2_256, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("HashAlgorithm", file_descriptor_proto()) + }) + } +} + +impl ::std::marker::Copy for HashAlgorithm { +} + +impl ::std::default::Default for HashAlgorithm { + fn default() -> Self { + HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED + } +} + +impl ::protobuf::reflect::ProtobufValue for HashAlgorithm { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum PublicKeyDetails { + PUBLIC_KEY_DETAILS_UNSPECIFIED = 0, + PKCS1_RSA_PKCS1V5 = 1, + PKCS1_RSA_PSS = 2, + PKIX_RSA_PKCS1V5 = 3, + PKIX_RSA_PSS = 4, + PKIX_ECDSA_P256_SHA_256 = 5, + PKIX_ECDSA_P256_HMAC_SHA_256 = 6, + PKIX_ED25519 = 7, +} + +impl ::protobuf::ProtobufEnum for PublicKeyDetails { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED), + 1 => ::std::option::Option::Some(PublicKeyDetails::PKCS1_RSA_PKCS1V5), + 2 => ::std::option::Option::Some(PublicKeyDetails::PKCS1_RSA_PSS), + 3 => ::std::option::Option::Some(PublicKeyDetails::PKIX_RSA_PKCS1V5), + 4 => ::std::option::Option::Some(PublicKeyDetails::PKIX_RSA_PSS), + 5 => ::std::option::Option::Some(PublicKeyDetails::PKIX_ECDSA_P256_SHA_256), + 6 => ::std::option::Option::Some(PublicKeyDetails::PKIX_ECDSA_P256_HMAC_SHA_256), + 7 => ::std::option::Option::Some(PublicKeyDetails::PKIX_ED25519), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [PublicKeyDetails] = &[ + PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED, + PublicKeyDetails::PKCS1_RSA_PKCS1V5, + PublicKeyDetails::PKCS1_RSA_PSS, + PublicKeyDetails::PKIX_RSA_PKCS1V5, + PublicKeyDetails::PKIX_RSA_PSS, + PublicKeyDetails::PKIX_ECDSA_P256_SHA_256, + PublicKeyDetails::PKIX_ECDSA_P256_HMAC_SHA_256, + PublicKeyDetails::PKIX_ED25519, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("PublicKeyDetails", file_descriptor_proto()) + }) + } +} + +impl ::std::marker::Copy for PublicKeyDetails { +} + +impl ::std::default::Default for PublicKeyDetails { + fn default() -> Self { + PublicKeyDetails::PUBLIC_KEY_DETAILS_UNSPECIFIED + } +} + +impl ::protobuf::reflect::ProtobufValue for PublicKeyDetails { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +#[derive(Clone,PartialEq,Eq,Debug,Hash)] +pub enum SubjectAlternativeNameType { + SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED = 0, + EMAIL = 1, + URI = 2, + OTHER_NAME = 3, +} + +impl ::protobuf::ProtobufEnum for SubjectAlternativeNameType { + fn value(&self) -> i32 { + *self as i32 + } + + fn from_i32(value: i32) -> ::std::option::Option { + match value { + 0 => ::std::option::Option::Some(SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED), + 1 => ::std::option::Option::Some(SubjectAlternativeNameType::EMAIL), + 2 => ::std::option::Option::Some(SubjectAlternativeNameType::URI), + 3 => ::std::option::Option::Some(SubjectAlternativeNameType::OTHER_NAME), + _ => ::std::option::Option::None + } + } + + fn values() -> &'static [Self] { + static values: &'static [SubjectAlternativeNameType] = &[ + SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED, + SubjectAlternativeNameType::EMAIL, + SubjectAlternativeNameType::URI, + SubjectAlternativeNameType::OTHER_NAME, + ]; + values + } + + fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::EnumDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + ::protobuf::reflect::EnumDescriptor::new_pb_name::("SubjectAlternativeNameType", file_descriptor_proto()) + }) + } +} + +impl ::std::marker::Copy for SubjectAlternativeNameType { +} + +impl ::std::default::Default for SubjectAlternativeNameType { + fn default() -> Self { + SubjectAlternativeNameType::SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED + } +} + +impl ::protobuf::reflect::ProtobufValue for SubjectAlternativeNameType { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Enum(::protobuf::ProtobufEnum::descriptor(self)) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x15sigstore_common.proto\x12\x16dev.sigstore.common.v1\x1a\x1fgoogle/\ + api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"i\n\nHa\ + shOutput\x12C\n\talgorithm\x18\x01\x20\x01(\x0e2%.dev.sigstore.common.v1\ + .HashAlgorithmR\talgorithm\x12\x16\n\x06digest\x18\x02\x20\x01(\x0cR\x06\ + digest\"\x85\x01\n\x10MessageSignature\x12N\n\x0emessage_digest\x18\x01\ + \x20\x01(\x0b2\".dev.sigstore.common.v1.HashOutputR\rmessageDigestB\x03\ + \xe0A\x02\x12!\n\tsignature\x18\x02\x20\x01(\x0cR\tsignatureB\x03\xe0A\ + \x02\"#\n\x05LogId\x12\x1a\n\x06key_id\x18\x01\x20\x01(\x0cR\x05keyIdB\ + \x03\xe0A\x02\"H\n\x16RFC3161SignedTimestamp\x12.\n\x10signed_timestamp\ + \x18\x01\x20\x01(\x0cR\x0fsignedTimestampB\x03\xe0A\x02\"\xd9\x01\n\tPub\ + licKey\x12\x20\n\traw_bytes\x18\x01\x20\x01(\x0cH\0R\x08rawBytes\x88\x01\ + \x01\x12I\n\x0bkey_details\x18\x02\x20\x01(\x0e2(.dev.sigstore.common.v1\ + .PublicKeyDetailsR\nkeyDetails\x12C\n\tvalid_for\x18\x03\x20\x01(\x0b2!.\ + dev.sigstore.common.v1.TimeRangeH\x01R\x08validFor\x88\x01\x01B\x0c\n\n_\ + raw_bytesB\x0c\n\n_valid_for\")\n\x13PublicKeyIdentifier\x12\x12\n\x04hi\ + nt\x18\x01\x20\x01(\tR\x04hint\"'\n\x10ObjectIdentifier\x12\x13\n\x02id\ + \x18\x01\x20\x03(\x05R\x02idB\x03\xe0A\x02\"m\n\x19ObjectIdentifierValue\ + Pair\x12:\n\x03oid\x18\x01\x20\x01(\x0b2(.dev.sigstore.common.v1.ObjectI\ + dentifierR\x03oid\x12\x14\n\x05value\x18\x02\x20\x01(\x0cR\x05value\"X\n\ + \x11DistinguishedName\x12\"\n\x0corganization\x18\x01\x20\x01(\tR\x0corg\ + anization\x12\x1f\n\x0bcommon_name\x18\x02\x20\x01(\tR\ncommonName\"3\n\ + \x0fX509Certificate\x12\x20\n\traw_bytes\x18\x01\x20\x01(\x0cR\x08rawByt\ + esB\x03\xe0A\x02\"\x9e\x01\n\x16SubjectAlternativeName\x12F\n\x04type\ + \x18\x01\x20\x01(\x0e22.dev.sigstore.common.v1.SubjectAlternativeNameTyp\ + eR\x04type\x12\x18\n\x06regexp\x18\x02\x20\x01(\tH\0R\x06regexp\x12\x16\ + \n\x05value\x18\x03\x20\x01(\tH\0R\x05valueB\n\n\x08identity\"c\n\x14X50\ + 9CertificateChain\x12K\n\x0ccertificates\x18\x01\x20\x03(\x0b2'.dev.sigs\ + tore.common.v1.X509CertificateR\x0ccertificates\"x\n\tTimeRange\x120\n\ + \x05start\x18\x01\x20\x01(\x0b2\x1a.google.protobuf.TimestampR\x05start\ + \x121\n\x03end\x18\x02\x20\x01(\x0b2\x1a.google.protobuf.TimestampH\0R\ + \x03end\x88\x01\x01B\x06\n\x04_end*=\n\rHashAlgorithm\x12\x1e\n\x1aHASH_\ + ALGORITHM_UNSPECIFIED\x10\0\x12\x0c\n\x08SHA2_256\x10\x01*\xd9\x01\n\x10\ + PublicKeyDetails\x12\"\n\x1ePUBLIC_KEY_DETAILS_UNSPECIFIED\x10\0\x12\x15\ + \n\x11PKCS1_RSA_PKCS1V5\x10\x01\x12\x11\n\rPKCS1_RSA_PSS\x10\x02\x12\x14\ + \n\x10PKIX_RSA_PKCS1V5\x10\x03\x12\x10\n\x0cPKIX_RSA_PSS\x10\x04\x12\x1b\ + \n\x17PKIX_ECDSA_P256_SHA_256\x10\x05\x12\x20\n\x1cPKIX_ECDSA_P256_HMAC_\ + SHA_256\x10\x06\x12\x10\n\x0cPKIX_ED25519\x10\x07*o\n\x1aSubjectAlternat\ + iveNameType\x12-\n)SUBJECT_ALTERNATIVE_NAME_TYPE_UNSPECIFIED\x10\0\x12\t\ + \n\x05EMAIL\x10\x01\x12\x07\n\x03URI\x10\x02\x12\x0e\n\nOTHER_NAME\x10\ + \x03Be\n\x1cdev.sigstore.proto.common.v1B\x0bCommonProtoP\x01Z6github.co\ + m/sigstore/protobuf-specs/gen/pb-go/common/v1b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/gen/pb-rust/src/sigstore_rekor.rs b/gen/pb-rust/src/sigstore_rekor.rs new file mode 100644 index 00000000..54fadec2 --- /dev/null +++ b/gen/pb-rust/src/sigstore_rekor.rs @@ -0,0 +1,1366 @@ +// This file is generated by rust-protobuf 2.28.0. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `sigstore_rekor.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; + +#[derive(PartialEq,Clone,Default)] +pub struct KindVersion { + // message fields + pub kind: ::std::string::String, + pub version: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a KindVersion { + fn default() -> &'a KindVersion { + ::default_instance() + } +} + +impl KindVersion { + pub fn new() -> KindVersion { + ::std::default::Default::default() + } + + // string kind = 1; + + + pub fn get_kind(&self) -> &str { + &self.kind + } + pub fn clear_kind(&mut self) { + self.kind.clear(); + } + + // Param is passed by value, moved + pub fn set_kind(&mut self, v: ::std::string::String) { + self.kind = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_kind(&mut self) -> &mut ::std::string::String { + &mut self.kind + } + + // Take field + pub fn take_kind(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.kind, ::std::string::String::new()) + } + + // string version = 2; + + + pub fn get_version(&self) -> &str { + &self.version + } + pub fn clear_version(&mut self) { + self.version.clear(); + } + + // Param is passed by value, moved + pub fn set_version(&mut self, v: ::std::string::String) { + self.version = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_version(&mut self) -> &mut ::std::string::String { + &mut self.version + } + + // Take field + pub fn take_version(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.version, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for KindVersion { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.kind)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.version)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.kind.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.kind); + } + if !self.version.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.version); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.kind.is_empty() { + os.write_string(1, &self.kind)?; + } + if !self.version.is_empty() { + os.write_string(2, &self.version)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> KindVersion { + KindVersion::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "kind", + |m: &KindVersion| { &m.kind }, + |m: &mut KindVersion| { &mut m.kind }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "version", + |m: &KindVersion| { &m.version }, + |m: &mut KindVersion| { &mut m.version }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "KindVersion", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static KindVersion { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(KindVersion::new) + } +} + +impl ::protobuf::Clear for KindVersion { + fn clear(&mut self) { + self.kind.clear(); + self.version.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for KindVersion { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for KindVersion { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Checkpoint { + // message fields + pub envelope: ::std::string::String, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Checkpoint { + fn default() -> &'a Checkpoint { + ::default_instance() + } +} + +impl Checkpoint { + pub fn new() -> Checkpoint { + ::std::default::Default::default() + } + + // string envelope = 1; + + + pub fn get_envelope(&self) -> &str { + &self.envelope + } + pub fn clear_envelope(&mut self) { + self.envelope.clear(); + } + + // Param is passed by value, moved + pub fn set_envelope(&mut self, v: ::std::string::String) { + self.envelope = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_envelope(&mut self) -> &mut ::std::string::String { + &mut self.envelope + } + + // Take field + pub fn take_envelope(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.envelope, ::std::string::String::new()) + } +} + +impl ::protobuf::Message for Checkpoint { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.envelope)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.envelope.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.envelope); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.envelope.is_empty() { + os.write_string(1, &self.envelope)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Checkpoint { + Checkpoint::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "envelope", + |m: &Checkpoint| { &m.envelope }, + |m: &mut Checkpoint| { &mut m.envelope }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "Checkpoint", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static Checkpoint { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(Checkpoint::new) + } +} + +impl ::protobuf::Clear for Checkpoint { + fn clear(&mut self) { + self.envelope.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Checkpoint { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Checkpoint { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct InclusionProof { + // message fields + pub log_index: i64, + pub root_hash: ::std::vec::Vec, + pub tree_size: i64, + pub hashes: ::protobuf::RepeatedField<::std::vec::Vec>, + pub checkpoint: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a InclusionProof { + fn default() -> &'a InclusionProof { + ::default_instance() + } +} + +impl InclusionProof { + pub fn new() -> InclusionProof { + ::std::default::Default::default() + } + + // int64 log_index = 1; + + + pub fn get_log_index(&self) -> i64 { + self.log_index + } + pub fn clear_log_index(&mut self) { + self.log_index = 0; + } + + // Param is passed by value, moved + pub fn set_log_index(&mut self, v: i64) { + self.log_index = v; + } + + // bytes root_hash = 2; + + + pub fn get_root_hash(&self) -> &[u8] { + &self.root_hash + } + pub fn clear_root_hash(&mut self) { + self.root_hash.clear(); + } + + // Param is passed by value, moved + pub fn set_root_hash(&mut self, v: ::std::vec::Vec) { + self.root_hash = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_root_hash(&mut self) -> &mut ::std::vec::Vec { + &mut self.root_hash + } + + // Take field + pub fn take_root_hash(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.root_hash, ::std::vec::Vec::new()) + } + + // int64 tree_size = 3; + + + pub fn get_tree_size(&self) -> i64 { + self.tree_size + } + pub fn clear_tree_size(&mut self) { + self.tree_size = 0; + } + + // Param is passed by value, moved + pub fn set_tree_size(&mut self, v: i64) { + self.tree_size = v; + } + + // repeated bytes hashes = 4; + + + pub fn get_hashes(&self) -> &[::std::vec::Vec] { + &self.hashes + } + pub fn clear_hashes(&mut self) { + self.hashes.clear(); + } + + // Param is passed by value, moved + pub fn set_hashes(&mut self, v: ::protobuf::RepeatedField<::std::vec::Vec>) { + self.hashes = v; + } + + // Mutable pointer to the field. + pub fn mut_hashes(&mut self) -> &mut ::protobuf::RepeatedField<::std::vec::Vec> { + &mut self.hashes + } + + // Take field + pub fn take_hashes(&mut self) -> ::protobuf::RepeatedField<::std::vec::Vec> { + ::std::mem::replace(&mut self.hashes, ::protobuf::RepeatedField::new()) + } + + // .dev.sigstore.rekor.v1.Checkpoint checkpoint = 5; + + + pub fn get_checkpoint(&self) -> &Checkpoint { + self.checkpoint.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_checkpoint(&mut self) { + self.checkpoint.clear(); + } + + pub fn has_checkpoint(&self) -> bool { + self.checkpoint.is_some() + } + + // Param is passed by value, moved + pub fn set_checkpoint(&mut self, v: Checkpoint) { + self.checkpoint = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_checkpoint(&mut self) -> &mut Checkpoint { + if self.checkpoint.is_none() { + self.checkpoint.set_default(); + } + self.checkpoint.as_mut().unwrap() + } + + // Take field + pub fn take_checkpoint(&mut self) -> Checkpoint { + self.checkpoint.take().unwrap_or_else(|| Checkpoint::new()) + } +} + +impl ::protobuf::Message for InclusionProof { + fn is_initialized(&self) -> bool { + for v in &self.checkpoint { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_int64()?; + self.log_index = tmp; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.root_hash)?; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_int64()?; + self.tree_size = tmp; + }, + 4 => { + ::protobuf::rt::read_repeated_bytes_into(wire_type, is, &mut self.hashes)?; + }, + 5 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.checkpoint)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.log_index != 0 { + my_size += ::protobuf::rt::value_size(1, self.log_index, ::protobuf::wire_format::WireTypeVarint); + } + if !self.root_hash.is_empty() { + my_size += ::protobuf::rt::bytes_size(2, &self.root_hash); + } + if self.tree_size != 0 { + my_size += ::protobuf::rt::value_size(3, self.tree_size, ::protobuf::wire_format::WireTypeVarint); + } + for value in &self.hashes { + my_size += ::protobuf::rt::bytes_size(4, &value); + }; + if let Some(ref v) = self.checkpoint.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.log_index != 0 { + os.write_int64(1, self.log_index)?; + } + if !self.root_hash.is_empty() { + os.write_bytes(2, &self.root_hash)?; + } + if self.tree_size != 0 { + os.write_int64(3, self.tree_size)?; + } + for v in &self.hashes { + os.write_bytes(4, &v)?; + }; + if let Some(ref v) = self.checkpoint.as_ref() { + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> InclusionProof { + InclusionProof::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "log_index", + |m: &InclusionProof| { &m.log_index }, + |m: &mut InclusionProof| { &mut m.log_index }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "root_hash", + |m: &InclusionProof| { &m.root_hash }, + |m: &mut InclusionProof| { &mut m.root_hash }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "tree_size", + |m: &InclusionProof| { &m.tree_size }, + |m: &mut InclusionProof| { &mut m.tree_size }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "hashes", + |m: &InclusionProof| { &m.hashes }, + |m: &mut InclusionProof| { &mut m.hashes }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "checkpoint", + |m: &InclusionProof| { &m.checkpoint }, + |m: &mut InclusionProof| { &mut m.checkpoint }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "InclusionProof", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static InclusionProof { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(InclusionProof::new) + } +} + +impl ::protobuf::Clear for InclusionProof { + fn clear(&mut self) { + self.log_index = 0; + self.root_hash.clear(); + self.tree_size = 0; + self.hashes.clear(); + self.checkpoint.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for InclusionProof { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for InclusionProof { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct InclusionPromise { + // message fields + pub signed_entry_timestamp: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a InclusionPromise { + fn default() -> &'a InclusionPromise { + ::default_instance() + } +} + +impl InclusionPromise { + pub fn new() -> InclusionPromise { + ::std::default::Default::default() + } + + // bytes signed_entry_timestamp = 1; + + + pub fn get_signed_entry_timestamp(&self) -> &[u8] { + &self.signed_entry_timestamp + } + pub fn clear_signed_entry_timestamp(&mut self) { + self.signed_entry_timestamp.clear(); + } + + // Param is passed by value, moved + pub fn set_signed_entry_timestamp(&mut self, v: ::std::vec::Vec) { + self.signed_entry_timestamp = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_signed_entry_timestamp(&mut self) -> &mut ::std::vec::Vec { + &mut self.signed_entry_timestamp + } + + // Take field + pub fn take_signed_entry_timestamp(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.signed_entry_timestamp, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for InclusionPromise { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.signed_entry_timestamp)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.signed_entry_timestamp.is_empty() { + my_size += ::protobuf::rt::bytes_size(1, &self.signed_entry_timestamp); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.signed_entry_timestamp.is_empty() { + os.write_bytes(1, &self.signed_entry_timestamp)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> InclusionPromise { + InclusionPromise::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "signed_entry_timestamp", + |m: &InclusionPromise| { &m.signed_entry_timestamp }, + |m: &mut InclusionPromise| { &mut m.signed_entry_timestamp }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "InclusionPromise", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static InclusionPromise { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(InclusionPromise::new) + } +} + +impl ::protobuf::Clear for InclusionPromise { + fn clear(&mut self) { + self.signed_entry_timestamp.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for InclusionPromise { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for InclusionPromise { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TransparencyLogEntry { + // message fields + pub log_index: i64, + pub log_id: ::protobuf::SingularPtrField, + pub kind_version: ::protobuf::SingularPtrField, + pub integrated_time: i64, + pub inclusion_promise: ::protobuf::SingularPtrField, + pub inclusion_proof: ::protobuf::SingularPtrField, + pub canonicalized_body: ::std::vec::Vec, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a TransparencyLogEntry { + fn default() -> &'a TransparencyLogEntry { + ::default_instance() + } +} + +impl TransparencyLogEntry { + pub fn new() -> TransparencyLogEntry { + ::std::default::Default::default() + } + + // int64 log_index = 1; + + + pub fn get_log_index(&self) -> i64 { + self.log_index + } + pub fn clear_log_index(&mut self) { + self.log_index = 0; + } + + // Param is passed by value, moved + pub fn set_log_index(&mut self, v: i64) { + self.log_index = v; + } + + // .dev.sigstore.common.v1.LogId log_id = 2; + + + pub fn get_log_id(&self) -> &super::sigstore_common::LogId { + self.log_id.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_log_id(&mut self) { + self.log_id.clear(); + } + + pub fn has_log_id(&self) -> bool { + self.log_id.is_some() + } + + // Param is passed by value, moved + pub fn set_log_id(&mut self, v: super::sigstore_common::LogId) { + self.log_id = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_log_id(&mut self) -> &mut super::sigstore_common::LogId { + if self.log_id.is_none() { + self.log_id.set_default(); + } + self.log_id.as_mut().unwrap() + } + + // Take field + pub fn take_log_id(&mut self) -> super::sigstore_common::LogId { + self.log_id.take().unwrap_or_else(|| super::sigstore_common::LogId::new()) + } + + // .dev.sigstore.rekor.v1.KindVersion kind_version = 3; + + + pub fn get_kind_version(&self) -> &KindVersion { + self.kind_version.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_kind_version(&mut self) { + self.kind_version.clear(); + } + + pub fn has_kind_version(&self) -> bool { + self.kind_version.is_some() + } + + // Param is passed by value, moved + pub fn set_kind_version(&mut self, v: KindVersion) { + self.kind_version = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_kind_version(&mut self) -> &mut KindVersion { + if self.kind_version.is_none() { + self.kind_version.set_default(); + } + self.kind_version.as_mut().unwrap() + } + + // Take field + pub fn take_kind_version(&mut self) -> KindVersion { + self.kind_version.take().unwrap_or_else(|| KindVersion::new()) + } + + // int64 integrated_time = 4; + + + pub fn get_integrated_time(&self) -> i64 { + self.integrated_time + } + pub fn clear_integrated_time(&mut self) { + self.integrated_time = 0; + } + + // Param is passed by value, moved + pub fn set_integrated_time(&mut self, v: i64) { + self.integrated_time = v; + } + + // .dev.sigstore.rekor.v1.InclusionPromise inclusion_promise = 5; + + + pub fn get_inclusion_promise(&self) -> &InclusionPromise { + self.inclusion_promise.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_inclusion_promise(&mut self) { + self.inclusion_promise.clear(); + } + + pub fn has_inclusion_promise(&self) -> bool { + self.inclusion_promise.is_some() + } + + // Param is passed by value, moved + pub fn set_inclusion_promise(&mut self, v: InclusionPromise) { + self.inclusion_promise = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_inclusion_promise(&mut self) -> &mut InclusionPromise { + if self.inclusion_promise.is_none() { + self.inclusion_promise.set_default(); + } + self.inclusion_promise.as_mut().unwrap() + } + + // Take field + pub fn take_inclusion_promise(&mut self) -> InclusionPromise { + self.inclusion_promise.take().unwrap_or_else(|| InclusionPromise::new()) + } + + // .dev.sigstore.rekor.v1.InclusionProof inclusion_proof = 6; + + + pub fn get_inclusion_proof(&self) -> &InclusionProof { + self.inclusion_proof.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_inclusion_proof(&mut self) { + self.inclusion_proof.clear(); + } + + pub fn has_inclusion_proof(&self) -> bool { + self.inclusion_proof.is_some() + } + + // Param is passed by value, moved + pub fn set_inclusion_proof(&mut self, v: InclusionProof) { + self.inclusion_proof = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_inclusion_proof(&mut self) -> &mut InclusionProof { + if self.inclusion_proof.is_none() { + self.inclusion_proof.set_default(); + } + self.inclusion_proof.as_mut().unwrap() + } + + // Take field + pub fn take_inclusion_proof(&mut self) -> InclusionProof { + self.inclusion_proof.take().unwrap_or_else(|| InclusionProof::new()) + } + + // bytes canonicalized_body = 7; + + + pub fn get_canonicalized_body(&self) -> &[u8] { + &self.canonicalized_body + } + pub fn clear_canonicalized_body(&mut self) { + self.canonicalized_body.clear(); + } + + // Param is passed by value, moved + pub fn set_canonicalized_body(&mut self, v: ::std::vec::Vec) { + self.canonicalized_body = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_canonicalized_body(&mut self) -> &mut ::std::vec::Vec { + &mut self.canonicalized_body + } + + // Take field + pub fn take_canonicalized_body(&mut self) -> ::std::vec::Vec { + ::std::mem::replace(&mut self.canonicalized_body, ::std::vec::Vec::new()) + } +} + +impl ::protobuf::Message for TransparencyLogEntry { + fn is_initialized(&self) -> bool { + for v in &self.log_id { + if !v.is_initialized() { + return false; + } + }; + for v in &self.kind_version { + if !v.is_initialized() { + return false; + } + }; + for v in &self.inclusion_promise { + if !v.is_initialized() { + return false; + } + }; + for v in &self.inclusion_proof { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_int64()?; + self.log_index = tmp; + }, + 2 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.log_id)?; + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.kind_version)?; + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_int64()?; + self.integrated_time = tmp; + }, + 5 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.inclusion_promise)?; + }, + 6 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.inclusion_proof)?; + }, + 7 => { + ::protobuf::rt::read_singular_proto3_bytes_into(wire_type, is, &mut self.canonicalized_body)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.log_index != 0 { + my_size += ::protobuf::rt::value_size(1, self.log_index, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.log_id.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.kind_version.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if self.integrated_time != 0 { + my_size += ::protobuf::rt::value_size(4, self.integrated_time, ::protobuf::wire_format::WireTypeVarint); + } + if let Some(ref v) = self.inclusion_promise.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.inclusion_proof.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if !self.canonicalized_body.is_empty() { + my_size += ::protobuf::rt::bytes_size(7, &self.canonicalized_body); + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.log_index != 0 { + os.write_int64(1, self.log_index)?; + } + if let Some(ref v) = self.log_id.as_ref() { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.kind_version.as_ref() { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if self.integrated_time != 0 { + os.write_int64(4, self.integrated_time)?; + } + if let Some(ref v) = self.inclusion_promise.as_ref() { + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.inclusion_proof.as_ref() { + os.write_tag(6, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if !self.canonicalized_body.is_empty() { + os.write_bytes(7, &self.canonicalized_body)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TransparencyLogEntry { + TransparencyLogEntry::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "log_index", + |m: &TransparencyLogEntry| { &m.log_index }, + |m: &mut TransparencyLogEntry| { &mut m.log_index }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "log_id", + |m: &TransparencyLogEntry| { &m.log_id }, + |m: &mut TransparencyLogEntry| { &mut m.log_id }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "kind_version", + |m: &TransparencyLogEntry| { &m.kind_version }, + |m: &mut TransparencyLogEntry| { &mut m.kind_version }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>( + "integrated_time", + |m: &TransparencyLogEntry| { &m.integrated_time }, + |m: &mut TransparencyLogEntry| { &mut m.integrated_time }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "inclusion_promise", + |m: &TransparencyLogEntry| { &m.inclusion_promise }, + |m: &mut TransparencyLogEntry| { &mut m.inclusion_promise }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "inclusion_proof", + |m: &TransparencyLogEntry| { &m.inclusion_proof }, + |m: &mut TransparencyLogEntry| { &mut m.inclusion_proof }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBytes>( + "canonicalized_body", + |m: &TransparencyLogEntry| { &m.canonicalized_body }, + |m: &mut TransparencyLogEntry| { &mut m.canonicalized_body }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "TransparencyLogEntry", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static TransparencyLogEntry { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(TransparencyLogEntry::new) + } +} + +impl ::protobuf::Clear for TransparencyLogEntry { + fn clear(&mut self) { + self.log_index = 0; + self.log_id.clear(); + self.kind_version.clear(); + self.integrated_time = 0; + self.inclusion_promise.clear(); + self.inclusion_proof.clear(); + self.canonicalized_body.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TransparencyLogEntry { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TransparencyLogEntry { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x14sigstore_rekor.proto\x12\x15dev.sigstore.rekor.v1\x1a\x1fgoogle/ap\ + i/field_behavior.proto\x1a\x15sigstore_common.proto\"E\n\x0bKindVersion\ + \x12\x17\n\x04kind\x18\x01\x20\x01(\tR\x04kindB\x03\xe0A\x02\x12\x1d\n\ + \x07version\x18\x02\x20\x01(\tR\x07versionB\x03\xe0A\x02\"-\n\nCheckpoin\ + t\x12\x1f\n\x08envelope\x18\x01\x20\x01(\tR\x08envelopeB\x03\xe0A\x02\"\ + \xdb\x01\n\x0eInclusionProof\x12\x20\n\tlog_index\x18\x01\x20\x01(\x03R\ + \x08logIndexB\x03\xe0A\x02\x12\x20\n\troot_hash\x18\x02\x20\x01(\x0cR\ + \x08rootHashB\x03\xe0A\x02\x12\x20\n\ttree_size\x18\x03\x20\x01(\x03R\ + \x08treeSizeB\x03\xe0A\x02\x12\x1b\n\x06hashes\x18\x04\x20\x03(\x0cR\x06\ + hashesB\x03\xe0A\x02\x12F\n\ncheckpoint\x18\x05\x20\x01(\x0b2!.dev.sigst\ + ore.rekor.v1.CheckpointR\ncheckpointB\x03\xe0A\x02\"M\n\x10InclusionProm\ + ise\x129\n\x16signed_entry_timestamp\x18\x01\x20\x01(\x0cR\x14signedEntr\ + yTimestampB\x03\xe0A\x02\"\xc7\x03\n\x14TransparencyLogEntry\x12\x20\n\t\ + log_index\x18\x01\x20\x01(\x03R\x08logIndexB\x03\xe0A\x02\x129\n\x06log_\ + id\x18\x02\x20\x01(\x0b2\x1d.dev.sigstore.common.v1.LogIdR\x05logIdB\x03\ + \xe0A\x02\x12J\n\x0ckind_version\x18\x03\x20\x01(\x0b2\".dev.sigstore.re\ + kor.v1.KindVersionR\x0bkindVersionB\x03\xe0A\x02\x12,\n\x0fintegrated_ti\ + me\x18\x04\x20\x01(\x03R\x0eintegratedTimeB\x03\xe0A\x02\x12T\n\x11inclu\ + sion_promise\x18\x05\x20\x01(\x0b2'.dev.sigstore.rekor.v1.InclusionPromi\ + seR\x10inclusionPromise\x12S\n\x0finclusion_proof\x18\x06\x20\x01(\x0b2%\ + .dev.sigstore.rekor.v1.InclusionProofR\x0einclusionProofB\x03\xe0A\x02\ + \x12-\n\x12canonicalized_body\x18\x07\x20\x01(\x0cR\x11canonicalizedBody\ + Bb\n\x1bdev.sigstore.proto.rekor.v1B\nRekorProtoP\x01Z5github.com/sigsto\ + re/protobuf-specs/gen/pb-go/rekor/v1b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/gen/pb-rust/src/sigstore_trustroot.rs b/gen/pb-rust/src/sigstore_trustroot.rs new file mode 100644 index 00000000..8c6d1f48 --- /dev/null +++ b/gen/pb-rust/src/sigstore_trustroot.rs @@ -0,0 +1,1049 @@ +// This file is generated by rust-protobuf 2.28.0. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `sigstore_trustroot.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; + +#[derive(PartialEq,Clone,Default)] +pub struct TransparencyLogInstance { + // message fields + pub base_url: ::std::string::String, + pub hash_algorithm: super::sigstore_common::HashAlgorithm, + pub public_key: ::protobuf::SingularPtrField, + pub log_id: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a TransparencyLogInstance { + fn default() -> &'a TransparencyLogInstance { + ::default_instance() + } +} + +impl TransparencyLogInstance { + pub fn new() -> TransparencyLogInstance { + ::std::default::Default::default() + } + + // string base_url = 1; + + + pub fn get_base_url(&self) -> &str { + &self.base_url + } + pub fn clear_base_url(&mut self) { + self.base_url.clear(); + } + + // Param is passed by value, moved + pub fn set_base_url(&mut self, v: ::std::string::String) { + self.base_url = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_base_url(&mut self) -> &mut ::std::string::String { + &mut self.base_url + } + + // Take field + pub fn take_base_url(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.base_url, ::std::string::String::new()) + } + + // .dev.sigstore.common.v1.HashAlgorithm hash_algorithm = 2; + + + pub fn get_hash_algorithm(&self) -> super::sigstore_common::HashAlgorithm { + self.hash_algorithm + } + pub fn clear_hash_algorithm(&mut self) { + self.hash_algorithm = super::sigstore_common::HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED; + } + + // Param is passed by value, moved + pub fn set_hash_algorithm(&mut self, v: super::sigstore_common::HashAlgorithm) { + self.hash_algorithm = v; + } + + // .dev.sigstore.common.v1.PublicKey public_key = 3; + + + pub fn get_public_key(&self) -> &super::sigstore_common::PublicKey { + self.public_key.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_public_key(&mut self) { + self.public_key.clear(); + } + + pub fn has_public_key(&self) -> bool { + self.public_key.is_some() + } + + // Param is passed by value, moved + pub fn set_public_key(&mut self, v: super::sigstore_common::PublicKey) { + self.public_key = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_public_key(&mut self) -> &mut super::sigstore_common::PublicKey { + if self.public_key.is_none() { + self.public_key.set_default(); + } + self.public_key.as_mut().unwrap() + } + + // Take field + pub fn take_public_key(&mut self) -> super::sigstore_common::PublicKey { + self.public_key.take().unwrap_or_else(|| super::sigstore_common::PublicKey::new()) + } + + // .dev.sigstore.common.v1.LogId log_id = 4; + + + pub fn get_log_id(&self) -> &super::sigstore_common::LogId { + self.log_id.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_log_id(&mut self) { + self.log_id.clear(); + } + + pub fn has_log_id(&self) -> bool { + self.log_id.is_some() + } + + // Param is passed by value, moved + pub fn set_log_id(&mut self, v: super::sigstore_common::LogId) { + self.log_id = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_log_id(&mut self) -> &mut super::sigstore_common::LogId { + if self.log_id.is_none() { + self.log_id.set_default(); + } + self.log_id.as_mut().unwrap() + } + + // Take field + pub fn take_log_id(&mut self) -> super::sigstore_common::LogId { + self.log_id.take().unwrap_or_else(|| super::sigstore_common::LogId::new()) + } +} + +impl ::protobuf::Message for TransparencyLogInstance { + fn is_initialized(&self) -> bool { + for v in &self.public_key { + if !v.is_initialized() { + return false; + } + }; + for v in &self.log_id { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.base_url)?; + }, + 2 => { + ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.hash_algorithm, 2, &mut self.unknown_fields)? + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.public_key)?; + }, + 4 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.log_id)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.base_url.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.base_url); + } + if self.hash_algorithm != super::sigstore_common::HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED { + my_size += ::protobuf::rt::enum_size(2, self.hash_algorithm); + } + if let Some(ref v) = self.public_key.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.log_id.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.base_url.is_empty() { + os.write_string(1, &self.base_url)?; + } + if self.hash_algorithm != super::sigstore_common::HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED { + os.write_enum(2, ::protobuf::ProtobufEnum::value(&self.hash_algorithm))?; + } + if let Some(ref v) = self.public_key.as_ref() { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.log_id.as_ref() { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TransparencyLogInstance { + TransparencyLogInstance::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "base_url", + |m: &TransparencyLogInstance| { &m.base_url }, + |m: &mut TransparencyLogInstance| { &mut m.base_url }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum>( + "hash_algorithm", + |m: &TransparencyLogInstance| { &m.hash_algorithm }, + |m: &mut TransparencyLogInstance| { &mut m.hash_algorithm }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "public_key", + |m: &TransparencyLogInstance| { &m.public_key }, + |m: &mut TransparencyLogInstance| { &mut m.public_key }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "log_id", + |m: &TransparencyLogInstance| { &m.log_id }, + |m: &mut TransparencyLogInstance| { &mut m.log_id }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "TransparencyLogInstance", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static TransparencyLogInstance { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(TransparencyLogInstance::new) + } +} + +impl ::protobuf::Clear for TransparencyLogInstance { + fn clear(&mut self) { + self.base_url.clear(); + self.hash_algorithm = super::sigstore_common::HashAlgorithm::HASH_ALGORITHM_UNSPECIFIED; + self.public_key.clear(); + self.log_id.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TransparencyLogInstance { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TransparencyLogInstance { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CertificateAuthority { + // message fields + pub subject: ::protobuf::SingularPtrField, + pub uri: ::std::string::String, + pub cert_chain: ::protobuf::SingularPtrField, + pub valid_for: ::protobuf::SingularPtrField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CertificateAuthority { + fn default() -> &'a CertificateAuthority { + ::default_instance() + } +} + +impl CertificateAuthority { + pub fn new() -> CertificateAuthority { + ::std::default::Default::default() + } + + // .dev.sigstore.common.v1.DistinguishedName subject = 1; + + + pub fn get_subject(&self) -> &super::sigstore_common::DistinguishedName { + self.subject.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_subject(&mut self) { + self.subject.clear(); + } + + pub fn has_subject(&self) -> bool { + self.subject.is_some() + } + + // Param is passed by value, moved + pub fn set_subject(&mut self, v: super::sigstore_common::DistinguishedName) { + self.subject = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_subject(&mut self) -> &mut super::sigstore_common::DistinguishedName { + if self.subject.is_none() { + self.subject.set_default(); + } + self.subject.as_mut().unwrap() + } + + // Take field + pub fn take_subject(&mut self) -> super::sigstore_common::DistinguishedName { + self.subject.take().unwrap_or_else(|| super::sigstore_common::DistinguishedName::new()) + } + + // string uri = 2; + + + pub fn get_uri(&self) -> &str { + &self.uri + } + pub fn clear_uri(&mut self) { + self.uri.clear(); + } + + // Param is passed by value, moved + pub fn set_uri(&mut self, v: ::std::string::String) { + self.uri = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_uri(&mut self) -> &mut ::std::string::String { + &mut self.uri + } + + // Take field + pub fn take_uri(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.uri, ::std::string::String::new()) + } + + // .dev.sigstore.common.v1.X509CertificateChain cert_chain = 3; + + + pub fn get_cert_chain(&self) -> &super::sigstore_common::X509CertificateChain { + self.cert_chain.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_cert_chain(&mut self) { + self.cert_chain.clear(); + } + + pub fn has_cert_chain(&self) -> bool { + self.cert_chain.is_some() + } + + // Param is passed by value, moved + pub fn set_cert_chain(&mut self, v: super::sigstore_common::X509CertificateChain) { + self.cert_chain = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_cert_chain(&mut self) -> &mut super::sigstore_common::X509CertificateChain { + if self.cert_chain.is_none() { + self.cert_chain.set_default(); + } + self.cert_chain.as_mut().unwrap() + } + + // Take field + pub fn take_cert_chain(&mut self) -> super::sigstore_common::X509CertificateChain { + self.cert_chain.take().unwrap_or_else(|| super::sigstore_common::X509CertificateChain::new()) + } + + // .dev.sigstore.common.v1.TimeRange valid_for = 4; + + + pub fn get_valid_for(&self) -> &super::sigstore_common::TimeRange { + self.valid_for.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_valid_for(&mut self) { + self.valid_for.clear(); + } + + pub fn has_valid_for(&self) -> bool { + self.valid_for.is_some() + } + + // Param is passed by value, moved + pub fn set_valid_for(&mut self, v: super::sigstore_common::TimeRange) { + self.valid_for = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_valid_for(&mut self) -> &mut super::sigstore_common::TimeRange { + if self.valid_for.is_none() { + self.valid_for.set_default(); + } + self.valid_for.as_mut().unwrap() + } + + // Take field + pub fn take_valid_for(&mut self) -> super::sigstore_common::TimeRange { + self.valid_for.take().unwrap_or_else(|| super::sigstore_common::TimeRange::new()) + } +} + +impl ::protobuf::Message for CertificateAuthority { + fn is_initialized(&self) -> bool { + for v in &self.subject { + if !v.is_initialized() { + return false; + } + }; + for v in &self.cert_chain { + if !v.is_initialized() { + return false; + } + }; + for v in &self.valid_for { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.subject)?; + }, + 2 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.uri)?; + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.cert_chain)?; + }, + 4 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.valid_for)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.subject.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if !self.uri.is_empty() { + my_size += ::protobuf::rt::string_size(2, &self.uri); + } + if let Some(ref v) = self.cert_chain.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.valid_for.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.subject.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if !self.uri.is_empty() { + os.write_string(2, &self.uri)?; + } + if let Some(ref v) = self.cert_chain.as_ref() { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.valid_for.as_ref() { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CertificateAuthority { + CertificateAuthority::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "subject", + |m: &CertificateAuthority| { &m.subject }, + |m: &mut CertificateAuthority| { &mut m.subject }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "uri", + |m: &CertificateAuthority| { &m.uri }, + |m: &mut CertificateAuthority| { &mut m.uri }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "cert_chain", + |m: &CertificateAuthority| { &m.cert_chain }, + |m: &mut CertificateAuthority| { &mut m.cert_chain }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "valid_for", + |m: &CertificateAuthority| { &m.valid_for }, + |m: &mut CertificateAuthority| { &mut m.valid_for }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CertificateAuthority", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CertificateAuthority { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CertificateAuthority::new) + } +} + +impl ::protobuf::Clear for CertificateAuthority { + fn clear(&mut self) { + self.subject.clear(); + self.uri.clear(); + self.cert_chain.clear(); + self.valid_for.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CertificateAuthority { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CertificateAuthority { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct TrustedRoot { + // message fields + pub media_type: ::std::string::String, + pub tlogs: ::protobuf::RepeatedField, + pub certificate_authorities: ::protobuf::RepeatedField, + pub ctlogs: ::protobuf::RepeatedField, + pub timestamp_authorities: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a TrustedRoot { + fn default() -> &'a TrustedRoot { + ::default_instance() + } +} + +impl TrustedRoot { + pub fn new() -> TrustedRoot { + ::std::default::Default::default() + } + + // string media_type = 1; + + + pub fn get_media_type(&self) -> &str { + &self.media_type + } + pub fn clear_media_type(&mut self) { + self.media_type.clear(); + } + + // Param is passed by value, moved + pub fn set_media_type(&mut self, v: ::std::string::String) { + self.media_type = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_media_type(&mut self) -> &mut ::std::string::String { + &mut self.media_type + } + + // Take field + pub fn take_media_type(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.media_type, ::std::string::String::new()) + } + + // repeated .dev.sigstore.trustroot.v1.TransparencyLogInstance tlogs = 2; + + + pub fn get_tlogs(&self) -> &[TransparencyLogInstance] { + &self.tlogs + } + pub fn clear_tlogs(&mut self) { + self.tlogs.clear(); + } + + // Param is passed by value, moved + pub fn set_tlogs(&mut self, v: ::protobuf::RepeatedField) { + self.tlogs = v; + } + + // Mutable pointer to the field. + pub fn mut_tlogs(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.tlogs + } + + // Take field + pub fn take_tlogs(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.tlogs, ::protobuf::RepeatedField::new()) + } + + // repeated .dev.sigstore.trustroot.v1.CertificateAuthority certificate_authorities = 3; + + + pub fn get_certificate_authorities(&self) -> &[CertificateAuthority] { + &self.certificate_authorities + } + pub fn clear_certificate_authorities(&mut self) { + self.certificate_authorities.clear(); + } + + // Param is passed by value, moved + pub fn set_certificate_authorities(&mut self, v: ::protobuf::RepeatedField) { + self.certificate_authorities = v; + } + + // Mutable pointer to the field. + pub fn mut_certificate_authorities(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.certificate_authorities + } + + // Take field + pub fn take_certificate_authorities(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.certificate_authorities, ::protobuf::RepeatedField::new()) + } + + // repeated .dev.sigstore.trustroot.v1.TransparencyLogInstance ctlogs = 4; + + + pub fn get_ctlogs(&self) -> &[TransparencyLogInstance] { + &self.ctlogs + } + pub fn clear_ctlogs(&mut self) { + self.ctlogs.clear(); + } + + // Param is passed by value, moved + pub fn set_ctlogs(&mut self, v: ::protobuf::RepeatedField) { + self.ctlogs = v; + } + + // Mutable pointer to the field. + pub fn mut_ctlogs(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.ctlogs + } + + // Take field + pub fn take_ctlogs(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.ctlogs, ::protobuf::RepeatedField::new()) + } + + // repeated .dev.sigstore.trustroot.v1.CertificateAuthority timestamp_authorities = 5; + + + pub fn get_timestamp_authorities(&self) -> &[CertificateAuthority] { + &self.timestamp_authorities + } + pub fn clear_timestamp_authorities(&mut self) { + self.timestamp_authorities.clear(); + } + + // Param is passed by value, moved + pub fn set_timestamp_authorities(&mut self, v: ::protobuf::RepeatedField) { + self.timestamp_authorities = v; + } + + // Mutable pointer to the field. + pub fn mut_timestamp_authorities(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.timestamp_authorities + } + + // Take field + pub fn take_timestamp_authorities(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.timestamp_authorities, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for TrustedRoot { + fn is_initialized(&self) -> bool { + for v in &self.tlogs { + if !v.is_initialized() { + return false; + } + }; + for v in &self.certificate_authorities { + if !v.is_initialized() { + return false; + } + }; + for v in &self.ctlogs { + if !v.is_initialized() { + return false; + } + }; + for v in &self.timestamp_authorities { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.media_type)?; + }, + 2 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.tlogs)?; + }, + 3 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.certificate_authorities)?; + }, + 4 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.ctlogs)?; + }, + 5 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.timestamp_authorities)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.media_type.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.media_type); + } + for value in &self.tlogs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.certificate_authorities { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.ctlogs { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + for value in &self.timestamp_authorities { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.media_type.is_empty() { + os.write_string(1, &self.media_type)?; + } + for v in &self.tlogs { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.certificate_authorities { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.ctlogs { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + for v in &self.timestamp_authorities { + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> TrustedRoot { + TrustedRoot::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "media_type", + |m: &TrustedRoot| { &m.media_type }, + |m: &mut TrustedRoot| { &mut m.media_type }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "tlogs", + |m: &TrustedRoot| { &m.tlogs }, + |m: &mut TrustedRoot| { &mut m.tlogs }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "certificate_authorities", + |m: &TrustedRoot| { &m.certificate_authorities }, + |m: &mut TrustedRoot| { &mut m.certificate_authorities }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "ctlogs", + |m: &TrustedRoot| { &m.ctlogs }, + |m: &mut TrustedRoot| { &mut m.ctlogs }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "timestamp_authorities", + |m: &TrustedRoot| { &m.timestamp_authorities }, + |m: &mut TrustedRoot| { &mut m.timestamp_authorities }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "TrustedRoot", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static TrustedRoot { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(TrustedRoot::new) + } +} + +impl ::protobuf::Clear for TrustedRoot { + fn clear(&mut self) { + self.media_type.clear(); + self.tlogs.clear(); + self.certificate_authorities.clear(); + self.ctlogs.clear(); + self.timestamp_authorities.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for TrustedRoot { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for TrustedRoot { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x18sigstore_trustroot.proto\x12\x19dev.sigstore.trustroot.v1\x1a\x15s\ + igstore_common.proto\"\xfa\x01\n\x17TransparencyLogInstance\x12\x19\n\ + \x08base_url\x18\x01\x20\x01(\tR\x07baseUrl\x12L\n\x0ehash_algorithm\x18\ + \x02\x20\x01(\x0e2%.dev.sigstore.common.v1.HashAlgorithmR\rhashAlgorithm\ + \x12@\n\npublic_key\x18\x03\x20\x01(\x0b2!.dev.sigstore.common.v1.Public\ + KeyR\tpublicKey\x124\n\x06log_id\x18\x04\x20\x01(\x0b2\x1d.dev.sigstore.\ + common.v1.LogIdR\x05logId\"\xfa\x01\n\x14CertificateAuthority\x12C\n\x07\ + subject\x18\x01\x20\x01(\x0b2).dev.sigstore.common.v1.DistinguishedNameR\ + \x07subject\x12\x10\n\x03uri\x18\x02\x20\x01(\tR\x03uri\x12K\n\ncert_cha\ + in\x18\x03\x20\x01(\x0b2,.dev.sigstore.common.v1.X509CertificateChainR\t\ + certChain\x12>\n\tvalid_for\x18\x04\x20\x01(\x0b2!.dev.sigstore.common.v\ + 1.TimeRangeR\x08validFor\"\x92\x03\n\x0bTrustedRoot\x12\x1d\n\nmedia_typ\ + e\x18\x01\x20\x01(\tR\tmediaType\x12H\n\x05tlogs\x18\x02\x20\x03(\x0b22.\ + dev.sigstore.trustroot.v1.TransparencyLogInstanceR\x05tlogs\x12h\n\x17ce\ + rtificate_authorities\x18\x03\x20\x03(\x0b2/.dev.sigstore.trustroot.v1.C\ + ertificateAuthorityR\x16certificateAuthorities\x12J\n\x06ctlogs\x18\x04\ + \x20\x03(\x0b22.dev.sigstore.trustroot.v1.TransparencyLogInstanceR\x06ct\ + logs\x12d\n\x15timestamp_authorities\x18\x05\x20\x03(\x0b2/.dev.sigstore\ + .trustroot.v1.CertificateAuthorityR\x14timestampAuthoritiesBn\n\x1fdev.s\ + igstore.proto.trustroot.v1B\x0eTrustRootProtoP\x01Z9github.com/sigstore/\ + protobuf-specs/gen/pb-go/trustroot/v1b\x06proto3\ +"; + +static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +} diff --git a/gen/pb-rust/src/sigstore_verification.rs b/gen/pb-rust/src/sigstore_verification.rs new file mode 100644 index 00000000..9192ac72 --- /dev/null +++ b/gen/pb-rust/src/sigstore_verification.rs @@ -0,0 +1,2501 @@ +// This file is generated by rust-protobuf 2.28.0. Do not edit +// @generated + +// https://github.com/rust-lang/rust-clippy/issues/702 +#![allow(unknown_lints)] +#![allow(clippy::all)] + +#![allow(unused_attributes)] +#![cfg_attr(rustfmt, rustfmt::skip)] + +#![allow(box_pointers)] +#![allow(dead_code)] +#![allow(missing_docs)] +#![allow(non_camel_case_types)] +#![allow(non_snake_case)] +#![allow(non_upper_case_globals)] +#![allow(trivial_casts)] +#![allow(unused_imports)] +#![allow(unused_results)] +//! Generated file from `sigstore_verification.proto` + +/// Generated files are compatible only with the same version +/// of protobuf runtime. +// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_28_0; + +#[derive(PartialEq,Clone,Default)] +pub struct CertificateIdentity { + // message fields + pub issuer: ::std::string::String, + pub san: ::protobuf::SingularPtrField, + pub oids: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CertificateIdentity { + fn default() -> &'a CertificateIdentity { + ::default_instance() + } +} + +impl CertificateIdentity { + pub fn new() -> CertificateIdentity { + ::std::default::Default::default() + } + + // string issuer = 1; + + + pub fn get_issuer(&self) -> &str { + &self.issuer + } + pub fn clear_issuer(&mut self) { + self.issuer.clear(); + } + + // Param is passed by value, moved + pub fn set_issuer(&mut self, v: ::std::string::String) { + self.issuer = v; + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_issuer(&mut self) -> &mut ::std::string::String { + &mut self.issuer + } + + // Take field + pub fn take_issuer(&mut self) -> ::std::string::String { + ::std::mem::replace(&mut self.issuer, ::std::string::String::new()) + } + + // .dev.sigstore.common.v1.SubjectAlternativeName san = 2; + + + pub fn get_san(&self) -> &super::sigstore_common::SubjectAlternativeName { + self.san.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_san(&mut self) { + self.san.clear(); + } + + pub fn has_san(&self) -> bool { + self.san.is_some() + } + + // Param is passed by value, moved + pub fn set_san(&mut self, v: super::sigstore_common::SubjectAlternativeName) { + self.san = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_san(&mut self) -> &mut super::sigstore_common::SubjectAlternativeName { + if self.san.is_none() { + self.san.set_default(); + } + self.san.as_mut().unwrap() + } + + // Take field + pub fn take_san(&mut self) -> super::sigstore_common::SubjectAlternativeName { + self.san.take().unwrap_or_else(|| super::sigstore_common::SubjectAlternativeName::new()) + } + + // repeated .dev.sigstore.common.v1.ObjectIdentifierValuePair oids = 3; + + + pub fn get_oids(&self) -> &[super::sigstore_common::ObjectIdentifierValuePair] { + &self.oids + } + pub fn clear_oids(&mut self) { + self.oids.clear(); + } + + // Param is passed by value, moved + pub fn set_oids(&mut self, v: ::protobuf::RepeatedField) { + self.oids = v; + } + + // Mutable pointer to the field. + pub fn mut_oids(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.oids + } + + // Take field + pub fn take_oids(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.oids, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for CertificateIdentity { + fn is_initialized(&self) -> bool { + for v in &self.san { + if !v.is_initialized() { + return false; + } + }; + for v in &self.oids { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.issuer)?; + }, + 2 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.san)?; + }, + 3 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.oids)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if !self.issuer.is_empty() { + my_size += ::protobuf::rt::string_size(1, &self.issuer); + } + if let Some(ref v) = self.san.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + for value in &self.oids { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if !self.issuer.is_empty() { + os.write_string(1, &self.issuer)?; + } + if let Some(ref v) = self.san.as_ref() { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + for v in &self.oids { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CertificateIdentity { + CertificateIdentity::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>( + "issuer", + |m: &CertificateIdentity| { &m.issuer }, + |m: &mut CertificateIdentity| { &mut m.issuer }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "san", + |m: &CertificateIdentity| { &m.san }, + |m: &mut CertificateIdentity| { &mut m.san }, + )); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "oids", + |m: &CertificateIdentity| { &m.oids }, + |m: &mut CertificateIdentity| { &mut m.oids }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CertificateIdentity", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CertificateIdentity { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CertificateIdentity::new) + } +} + +impl ::protobuf::Clear for CertificateIdentity { + fn clear(&mut self) { + self.issuer.clear(); + self.san.clear(); + self.oids.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CertificateIdentity { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CertificateIdentity { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct CertificateIdentities { + // message fields + pub identities: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a CertificateIdentities { + fn default() -> &'a CertificateIdentities { + ::default_instance() + } +} + +impl CertificateIdentities { + pub fn new() -> CertificateIdentities { + ::std::default::Default::default() + } + + // repeated .dev.sigstore.verification.v1.CertificateIdentity identities = 1; + + + pub fn get_identities(&self) -> &[CertificateIdentity] { + &self.identities + } + pub fn clear_identities(&mut self) { + self.identities.clear(); + } + + // Param is passed by value, moved + pub fn set_identities(&mut self, v: ::protobuf::RepeatedField) { + self.identities = v; + } + + // Mutable pointer to the field. + pub fn mut_identities(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.identities + } + + // Take field + pub fn take_identities(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.identities, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for CertificateIdentities { + fn is_initialized(&self) -> bool { + for v in &self.identities { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.identities)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.identities { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + for v in &self.identities { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> CertificateIdentities { + CertificateIdentities::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "identities", + |m: &CertificateIdentities| { &m.identities }, + |m: &mut CertificateIdentities| { &mut m.identities }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "CertificateIdentities", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static CertificateIdentities { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(CertificateIdentities::new) + } +} + +impl ::protobuf::Clear for CertificateIdentities { + fn clear(&mut self) { + self.identities.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for CertificateIdentities { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for CertificateIdentities { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct PublicKeyIdentities { + // message fields + pub public_keys: ::protobuf::RepeatedField, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a PublicKeyIdentities { + fn default() -> &'a PublicKeyIdentities { + ::default_instance() + } +} + +impl PublicKeyIdentities { + pub fn new() -> PublicKeyIdentities { + ::std::default::Default::default() + } + + // repeated .dev.sigstore.common.v1.PublicKey public_keys = 1; + + + pub fn get_public_keys(&self) -> &[super::sigstore_common::PublicKey] { + &self.public_keys + } + pub fn clear_public_keys(&mut self) { + self.public_keys.clear(); + } + + // Param is passed by value, moved + pub fn set_public_keys(&mut self, v: ::protobuf::RepeatedField) { + self.public_keys = v; + } + + // Mutable pointer to the field. + pub fn mut_public_keys(&mut self) -> &mut ::protobuf::RepeatedField { + &mut self.public_keys + } + + // Take field + pub fn take_public_keys(&mut self) -> ::protobuf::RepeatedField { + ::std::mem::replace(&mut self.public_keys, ::protobuf::RepeatedField::new()) + } +} + +impl ::protobuf::Message for PublicKeyIdentities { + fn is_initialized(&self) -> bool { + for v in &self.public_keys { + if !v.is_initialized() { + return false; + } + }; + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_repeated_message_into(wire_type, is, &mut self.public_keys)?; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + for value in &self.public_keys { + let len = value.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }; + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + for v in &self.public_keys { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }; + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> PublicKeyIdentities { + PublicKeyIdentities::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "public_keys", + |m: &PublicKeyIdentities| { &m.public_keys }, + |m: &mut PublicKeyIdentities| { &mut m.public_keys }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "PublicKeyIdentities", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static PublicKeyIdentities { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(PublicKeyIdentities::new) + } +} + +impl ::protobuf::Clear for PublicKeyIdentities { + fn clear(&mut self) { + self.public_keys.clear(); + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for PublicKeyIdentities { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for PublicKeyIdentities { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ArtifactVerificationOptions { + // message oneof groups + pub signers: ::std::option::Option, + pub _tlog_options: ::std::option::Option, + pub _ctlog_options: ::std::option::Option, + pub _tsa_options: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ArtifactVerificationOptions { + fn default() -> &'a ArtifactVerificationOptions { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum ArtifactVerificationOptions_oneof_signers { + certificate_identities(CertificateIdentities), + public_keys(PublicKeyIdentities), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum ArtifactVerificationOptions_oneof__tlog_options { + tlog_options(ArtifactVerificationOptions_TlogOptions), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum ArtifactVerificationOptions_oneof__ctlog_options { + ctlog_options(ArtifactVerificationOptions_CtlogOptions), +} + +#[derive(Clone,PartialEq,Debug)] +pub enum ArtifactVerificationOptions_oneof__tsa_options { + tsa_options(ArtifactVerificationOptions_TimestampAuthorityOptions), +} + +impl ArtifactVerificationOptions { + pub fn new() -> ArtifactVerificationOptions { + ::std::default::Default::default() + } + + // .dev.sigstore.verification.v1.CertificateIdentities certificate_identities = 1; + + + pub fn get_certificate_identities(&self) -> &CertificateIdentities { + match self.signers { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_certificate_identities(&mut self) { + self.signers = ::std::option::Option::None; + } + + pub fn has_certificate_identities(&self) -> bool { + match self.signers { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_certificate_identities(&mut self, v: CertificateIdentities) { + self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(v)) + } + + // Mutable pointer to the field. + pub fn mut_certificate_identities(&mut self) -> &mut CertificateIdentities { + if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(_)) = self.signers { + } else { + self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(CertificateIdentities::new())); + } + match self.signers { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_certificate_identities(&mut self) -> CertificateIdentities { + if self.has_certificate_identities() { + match self.signers.take() { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(v)) => v, + _ => panic!(), + } + } else { + CertificateIdentities::new() + } + } + + // .dev.sigstore.verification.v1.PublicKeyIdentities public_keys = 2; + + + pub fn get_public_keys(&self) -> &PublicKeyIdentities { + match self.signers { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_public_keys(&mut self) { + self.signers = ::std::option::Option::None; + } + + pub fn has_public_keys(&self) -> bool { + match self.signers { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_public_keys(&mut self, v: PublicKeyIdentities) { + self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(v)) + } + + // Mutable pointer to the field. + pub fn mut_public_keys(&mut self) -> &mut PublicKeyIdentities { + if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(_)) = self.signers { + } else { + self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(PublicKeyIdentities::new())); + } + match self.signers { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_public_keys(&mut self) -> PublicKeyIdentities { + if self.has_public_keys() { + match self.signers.take() { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(v)) => v, + _ => panic!(), + } + } else { + PublicKeyIdentities::new() + } + } + + // .dev.sigstore.verification.v1.ArtifactVerificationOptions.TlogOptions tlog_options = 3; + + + pub fn get_tlog_options(&self) -> &ArtifactVerificationOptions_TlogOptions { + match self._tlog_options { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_tlog_options(&mut self) { + self._tlog_options = ::std::option::Option::None; + } + + pub fn has_tlog_options(&self) -> bool { + match self._tlog_options { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_tlog_options(&mut self, v: ArtifactVerificationOptions_TlogOptions) { + self._tlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(v)) + } + + // Mutable pointer to the field. + pub fn mut_tlog_options(&mut self) -> &mut ArtifactVerificationOptions_TlogOptions { + if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(_)) = self._tlog_options { + } else { + self._tlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ArtifactVerificationOptions_TlogOptions::new())); + } + match self._tlog_options { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_tlog_options(&mut self) -> ArtifactVerificationOptions_TlogOptions { + if self.has_tlog_options() { + match self._tlog_options.take() { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(v)) => v, + _ => panic!(), + } + } else { + ArtifactVerificationOptions_TlogOptions::new() + } + } + + // .dev.sigstore.verification.v1.ArtifactVerificationOptions.CtlogOptions ctlog_options = 4; + + + pub fn get_ctlog_options(&self) -> &ArtifactVerificationOptions_CtlogOptions { + match self._ctlog_options { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_ctlog_options(&mut self) { + self._ctlog_options = ::std::option::Option::None; + } + + pub fn has_ctlog_options(&self) -> bool { + match self._ctlog_options { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_ctlog_options(&mut self, v: ArtifactVerificationOptions_CtlogOptions) { + self._ctlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(v)) + } + + // Mutable pointer to the field. + pub fn mut_ctlog_options(&mut self) -> &mut ArtifactVerificationOptions_CtlogOptions { + if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(_)) = self._ctlog_options { + } else { + self._ctlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ArtifactVerificationOptions_CtlogOptions::new())); + } + match self._ctlog_options { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_ctlog_options(&mut self) -> ArtifactVerificationOptions_CtlogOptions { + if self.has_ctlog_options() { + match self._ctlog_options.take() { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(v)) => v, + _ => panic!(), + } + } else { + ArtifactVerificationOptions_CtlogOptions::new() + } + } + + // .dev.sigstore.verification.v1.ArtifactVerificationOptions.TimestampAuthorityOptions tsa_options = 5; + + + pub fn get_tsa_options(&self) -> &ArtifactVerificationOptions_TimestampAuthorityOptions { + match self._tsa_options { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_tsa_options(&mut self) { + self._tsa_options = ::std::option::Option::None; + } + + pub fn has_tsa_options(&self) -> bool { + match self._tsa_options { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_tsa_options(&mut self, v: ArtifactVerificationOptions_TimestampAuthorityOptions) { + self._tsa_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(v)) + } + + // Mutable pointer to the field. + pub fn mut_tsa_options(&mut self) -> &mut ArtifactVerificationOptions_TimestampAuthorityOptions { + if let ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(_)) = self._tsa_options { + } else { + self._tsa_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ArtifactVerificationOptions_TimestampAuthorityOptions::new())); + } + match self._tsa_options { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_tsa_options(&mut self) -> ArtifactVerificationOptions_TimestampAuthorityOptions { + if self.has_tsa_options() { + match self._tsa_options.take() { + ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(v)) => v, + _ => panic!(), + } + } else { + ArtifactVerificationOptions_TimestampAuthorityOptions::new() + } + } +} + +impl ::protobuf::Message for ArtifactVerificationOptions { + fn is_initialized(&self) -> bool { + if let Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(ref v)) = self.signers { + if !v.is_initialized() { + return false; + } + } + if let Some(ArtifactVerificationOptions_oneof_signers::public_keys(ref v)) = self.signers { + if !v.is_initialized() { + return false; + } + } + if let Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref v)) = self._tlog_options { + if !v.is_initialized() { + return false; + } + } + if let Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref v)) = self._ctlog_options { + if !v.is_initialized() { + return false; + } + } + if let Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref v)) = self._tsa_options { + if !v.is_initialized() { + return false; + } + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::certificate_identities(is.read_message()?)); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.signers = ::std::option::Option::Some(ArtifactVerificationOptions_oneof_signers::public_keys(is.read_message()?)); + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self._tlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tlog_options::tlog_options(is.read_message()?)); + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self._ctlog_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(is.read_message()?)); + }, + 5 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self._tsa_options = ::std::option::Option::Some(ArtifactVerificationOptions_oneof__tsa_options::tsa_options(is.read_message()?)); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let ::std::option::Option::Some(ref v) = self.signers { + match v { + &ArtifactVerificationOptions_oneof_signers::certificate_identities(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + &ArtifactVerificationOptions_oneof_signers::public_keys(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self._tlog_options { + match v { + &ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self._ctlog_options { + match v { + &ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self._tsa_options { + match v { + &ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if let ::std::option::Option::Some(ref v) = self.signers { + match v { + &ArtifactVerificationOptions_oneof_signers::certificate_identities(ref v) => { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + &ArtifactVerificationOptions_oneof_signers::public_keys(ref v) => { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self._tlog_options { + match v { + &ArtifactVerificationOptions_oneof__tlog_options::tlog_options(ref v) => { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self._ctlog_options { + match v { + &ArtifactVerificationOptions_oneof__ctlog_options::ctlog_options(ref v) => { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + }; + } + if let ::std::option::Option::Some(ref v) = self._tsa_options { + match v { + &ArtifactVerificationOptions_oneof__tsa_options::tsa_options(ref v) => { + os.write_tag(5, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ArtifactVerificationOptions { + ArtifactVerificationOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, CertificateIdentities>( + "certificate_identities", + ArtifactVerificationOptions::has_certificate_identities, + ArtifactVerificationOptions::get_certificate_identities, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, PublicKeyIdentities>( + "public_keys", + ArtifactVerificationOptions::has_public_keys, + ArtifactVerificationOptions::get_public_keys, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ArtifactVerificationOptions_TlogOptions>( + "tlog_options", + ArtifactVerificationOptions::has_tlog_options, + ArtifactVerificationOptions::get_tlog_options, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ArtifactVerificationOptions_CtlogOptions>( + "ctlog_options", + ArtifactVerificationOptions::has_ctlog_options, + ArtifactVerificationOptions::get_ctlog_options, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ArtifactVerificationOptions_TimestampAuthorityOptions>( + "tsa_options", + ArtifactVerificationOptions::has_tsa_options, + ArtifactVerificationOptions::get_tsa_options, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "ArtifactVerificationOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ArtifactVerificationOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(ArtifactVerificationOptions::new) + } +} + +impl ::protobuf::Clear for ArtifactVerificationOptions { + fn clear(&mut self) { + self.signers = ::std::option::Option::None; + self.signers = ::std::option::Option::None; + self._tlog_options = ::std::option::Option::None; + self._ctlog_options = ::std::option::Option::None; + self._tsa_options = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ArtifactVerificationOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ArtifactVerificationOptions { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ArtifactVerificationOptions_TlogOptions { + // message fields + pub threshold: i32, + pub perform_online_verification: bool, + pub disable: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ArtifactVerificationOptions_TlogOptions { + fn default() -> &'a ArtifactVerificationOptions_TlogOptions { + ::default_instance() + } +} + +impl ArtifactVerificationOptions_TlogOptions { + pub fn new() -> ArtifactVerificationOptions_TlogOptions { + ::std::default::Default::default() + } + + // int32 threshold = 1; + + + pub fn get_threshold(&self) -> i32 { + self.threshold + } + pub fn clear_threshold(&mut self) { + self.threshold = 0; + } + + // Param is passed by value, moved + pub fn set_threshold(&mut self, v: i32) { + self.threshold = v; + } + + // bool perform_online_verification = 2; + + + pub fn get_perform_online_verification(&self) -> bool { + self.perform_online_verification + } + pub fn clear_perform_online_verification(&mut self) { + self.perform_online_verification = false; + } + + // Param is passed by value, moved + pub fn set_perform_online_verification(&mut self, v: bool) { + self.perform_online_verification = v; + } + + // bool disable = 3; + + + pub fn get_disable(&self) -> bool { + self.disable + } + pub fn clear_disable(&mut self) { + self.disable = false; + } + + // Param is passed by value, moved + pub fn set_disable(&mut self, v: bool) { + self.disable = v; + } +} + +impl ::protobuf::Message for ArtifactVerificationOptions_TlogOptions { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_int32()?; + self.threshold = tmp; + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.perform_online_verification = tmp; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.disable = tmp; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.threshold != 0 { + my_size += ::protobuf::rt::value_size(1, self.threshold, ::protobuf::wire_format::WireTypeVarint); + } + if self.perform_online_verification != false { + my_size += 2; + } + if self.disable != false { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.threshold != 0 { + os.write_int32(1, self.threshold)?; + } + if self.perform_online_verification != false { + os.write_bool(2, self.perform_online_verification)?; + } + if self.disable != false { + os.write_bool(3, self.disable)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ArtifactVerificationOptions_TlogOptions { + ArtifactVerificationOptions_TlogOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "threshold", + |m: &ArtifactVerificationOptions_TlogOptions| { &m.threshold }, + |m: &mut ArtifactVerificationOptions_TlogOptions| { &mut m.threshold }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "perform_online_verification", + |m: &ArtifactVerificationOptions_TlogOptions| { &m.perform_online_verification }, + |m: &mut ArtifactVerificationOptions_TlogOptions| { &mut m.perform_online_verification }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "disable", + |m: &ArtifactVerificationOptions_TlogOptions| { &m.disable }, + |m: &mut ArtifactVerificationOptions_TlogOptions| { &mut m.disable }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "ArtifactVerificationOptions.TlogOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ArtifactVerificationOptions_TlogOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(ArtifactVerificationOptions_TlogOptions::new) + } +} + +impl ::protobuf::Clear for ArtifactVerificationOptions_TlogOptions { + fn clear(&mut self) { + self.threshold = 0; + self.perform_online_verification = false; + self.disable = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ArtifactVerificationOptions_TlogOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ArtifactVerificationOptions_TlogOptions { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ArtifactVerificationOptions_CtlogOptions { + // message fields + pub threshold: i32, + pub detached_sct: bool, + pub disable: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ArtifactVerificationOptions_CtlogOptions { + fn default() -> &'a ArtifactVerificationOptions_CtlogOptions { + ::default_instance() + } +} + +impl ArtifactVerificationOptions_CtlogOptions { + pub fn new() -> ArtifactVerificationOptions_CtlogOptions { + ::std::default::Default::default() + } + + // int32 threshold = 1; + + + pub fn get_threshold(&self) -> i32 { + self.threshold + } + pub fn clear_threshold(&mut self) { + self.threshold = 0; + } + + // Param is passed by value, moved + pub fn set_threshold(&mut self, v: i32) { + self.threshold = v; + } + + // bool detached_sct = 2; + + + pub fn get_detached_sct(&self) -> bool { + self.detached_sct + } + pub fn clear_detached_sct(&mut self) { + self.detached_sct = false; + } + + // Param is passed by value, moved + pub fn set_detached_sct(&mut self, v: bool) { + self.detached_sct = v; + } + + // bool disable = 3; + + + pub fn get_disable(&self) -> bool { + self.disable + } + pub fn clear_disable(&mut self) { + self.disable = false; + } + + // Param is passed by value, moved + pub fn set_disable(&mut self, v: bool) { + self.disable = v; + } +} + +impl ::protobuf::Message for ArtifactVerificationOptions_CtlogOptions { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_int32()?; + self.threshold = tmp; + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.detached_sct = tmp; + }, + 3 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.disable = tmp; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.threshold != 0 { + my_size += ::protobuf::rt::value_size(1, self.threshold, ::protobuf::wire_format::WireTypeVarint); + } + if self.detached_sct != false { + my_size += 2; + } + if self.disable != false { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.threshold != 0 { + os.write_int32(1, self.threshold)?; + } + if self.detached_sct != false { + os.write_bool(2, self.detached_sct)?; + } + if self.disable != false { + os.write_bool(3, self.disable)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ArtifactVerificationOptions_CtlogOptions { + ArtifactVerificationOptions_CtlogOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "threshold", + |m: &ArtifactVerificationOptions_CtlogOptions| { &m.threshold }, + |m: &mut ArtifactVerificationOptions_CtlogOptions| { &mut m.threshold }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "detached_sct", + |m: &ArtifactVerificationOptions_CtlogOptions| { &m.detached_sct }, + |m: &mut ArtifactVerificationOptions_CtlogOptions| { &mut m.detached_sct }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "disable", + |m: &ArtifactVerificationOptions_CtlogOptions| { &m.disable }, + |m: &mut ArtifactVerificationOptions_CtlogOptions| { &mut m.disable }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "ArtifactVerificationOptions.CtlogOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ArtifactVerificationOptions_CtlogOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(ArtifactVerificationOptions_CtlogOptions::new) + } +} + +impl ::protobuf::Clear for ArtifactVerificationOptions_CtlogOptions { + fn clear(&mut self) { + self.threshold = 0; + self.detached_sct = false; + self.disable = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ArtifactVerificationOptions_CtlogOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ArtifactVerificationOptions_CtlogOptions { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct ArtifactVerificationOptions_TimestampAuthorityOptions { + // message fields + pub threshold: i32, + pub disable: bool, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a ArtifactVerificationOptions_TimestampAuthorityOptions { + fn default() -> &'a ArtifactVerificationOptions_TimestampAuthorityOptions { + ::default_instance() + } +} + +impl ArtifactVerificationOptions_TimestampAuthorityOptions { + pub fn new() -> ArtifactVerificationOptions_TimestampAuthorityOptions { + ::std::default::Default::default() + } + + // int32 threshold = 1; + + + pub fn get_threshold(&self) -> i32 { + self.threshold + } + pub fn clear_threshold(&mut self) { + self.threshold = 0; + } + + // Param is passed by value, moved + pub fn set_threshold(&mut self, v: i32) { + self.threshold = v; + } + + // bool disable = 2; + + + pub fn get_disable(&self) -> bool { + self.disable + } + pub fn clear_disable(&mut self) { + self.disable = false; + } + + // Param is passed by value, moved + pub fn set_disable(&mut self, v: bool) { + self.disable = v; + } +} + +impl ::protobuf::Message for ArtifactVerificationOptions_TimestampAuthorityOptions { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_int32()?; + self.threshold = tmp; + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeVarint { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + let tmp = is.read_bool()?; + self.disable = tmp; + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if self.threshold != 0 { + my_size += ::protobuf::rt::value_size(1, self.threshold, ::protobuf::wire_format::WireTypeVarint); + } + if self.disable != false { + my_size += 2; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if self.threshold != 0 { + os.write_int32(1, self.threshold)?; + } + if self.disable != false { + os.write_bool(2, self.disable)?; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> ArtifactVerificationOptions_TimestampAuthorityOptions { + ArtifactVerificationOptions_TimestampAuthorityOptions::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt32>( + "threshold", + |m: &ArtifactVerificationOptions_TimestampAuthorityOptions| { &m.threshold }, + |m: &mut ArtifactVerificationOptions_TimestampAuthorityOptions| { &mut m.threshold }, + )); + fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeBool>( + "disable", + |m: &ArtifactVerificationOptions_TimestampAuthorityOptions| { &m.disable }, + |m: &mut ArtifactVerificationOptions_TimestampAuthorityOptions| { &mut m.disable }, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "ArtifactVerificationOptions.TimestampAuthorityOptions", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static ArtifactVerificationOptions_TimestampAuthorityOptions { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(ArtifactVerificationOptions_TimestampAuthorityOptions::new) + } +} + +impl ::protobuf::Clear for ArtifactVerificationOptions_TimestampAuthorityOptions { + fn clear(&mut self) { + self.threshold = 0; + self.disable = false; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for ArtifactVerificationOptions_TimestampAuthorityOptions { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for ArtifactVerificationOptions_TimestampAuthorityOptions { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Artifact { + // message oneof groups + pub data: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Artifact { + fn default() -> &'a Artifact { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum Artifact_oneof_data { + artifact_uri(::std::string::String), + artifact(::std::vec::Vec), +} + +impl Artifact { + pub fn new() -> Artifact { + ::std::default::Default::default() + } + + // string artifact_uri = 1; + + + pub fn get_artifact_uri(&self) -> &str { + match self.data { + ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(ref v)) => v, + _ => "", + } + } + pub fn clear_artifact_uri(&mut self) { + self.data = ::std::option::Option::None; + } + + pub fn has_artifact_uri(&self) -> bool { + match self.data { + ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_artifact_uri(&mut self, v: ::std::string::String) { + self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(v)) + } + + // Mutable pointer to the field. + pub fn mut_artifact_uri(&mut self) -> &mut ::std::string::String { + if let ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(_)) = self.data { + } else { + self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(::std::string::String::new())); + } + match self.data { + ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_artifact_uri(&mut self) -> ::std::string::String { + if self.has_artifact_uri() { + match self.data.take() { + ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(v)) => v, + _ => panic!(), + } + } else { + ::std::string::String::new() + } + } + + // bytes artifact = 2; + + + pub fn get_artifact(&self) -> &[u8] { + match self.data { + ::std::option::Option::Some(Artifact_oneof_data::artifact(ref v)) => v, + _ => &[], + } + } + pub fn clear_artifact(&mut self) { + self.data = ::std::option::Option::None; + } + + pub fn has_artifact(&self) -> bool { + match self.data { + ::std::option::Option::Some(Artifact_oneof_data::artifact(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_artifact(&mut self, v: ::std::vec::Vec) { + self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact(v)) + } + + // Mutable pointer to the field. + pub fn mut_artifact(&mut self) -> &mut ::std::vec::Vec { + if let ::std::option::Option::Some(Artifact_oneof_data::artifact(_)) = self.data { + } else { + self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact(::std::vec::Vec::new())); + } + match self.data { + ::std::option::Option::Some(Artifact_oneof_data::artifact(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_artifact(&mut self) -> ::std::vec::Vec { + if self.has_artifact() { + match self.data.take() { + ::std::option::Option::Some(Artifact_oneof_data::artifact(v)) => v, + _ => panic!(), + } + } else { + ::std::vec::Vec::new() + } + } +} + +impl ::protobuf::Message for Artifact { + fn is_initialized(&self) -> bool { + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact_uri(is.read_string()?)); + }, + 2 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self.data = ::std::option::Option::Some(Artifact_oneof_data::artifact(is.read_bytes()?)); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let ::std::option::Option::Some(ref v) = self.data { + match v { + &Artifact_oneof_data::artifact_uri(ref v) => { + my_size += ::protobuf::rt::string_size(1, &v); + }, + &Artifact_oneof_data::artifact(ref v) => { + my_size += ::protobuf::rt::bytes_size(2, &v); + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if let ::std::option::Option::Some(ref v) = self.data { + match v { + &Artifact_oneof_data::artifact_uri(ref v) => { + os.write_string(1, v)?; + }, + &Artifact_oneof_data::artifact(ref v) => { + os.write_bytes(2, v)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Artifact { + Artifact::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>( + "artifact_uri", + Artifact::has_artifact_uri, + Artifact::get_artifact_uri, + )); + fields.push(::protobuf::reflect::accessor::make_singular_bytes_accessor::<_>( + "artifact", + Artifact::has_artifact, + Artifact::get_artifact, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "Artifact", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static Artifact { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(Artifact::new) + } +} + +impl ::protobuf::Clear for Artifact { + fn clear(&mut self) { + self.data = ::std::option::Option::None; + self.data = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Artifact { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Artifact { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +#[derive(PartialEq,Clone,Default)] +pub struct Input { + // message fields + pub artifact_trust_root: ::protobuf::SingularPtrField, + pub artifact_verification_options: ::protobuf::SingularPtrField, + pub bundle: ::protobuf::SingularPtrField, + // message oneof groups + pub _artifact: ::std::option::Option, + // special fields + pub unknown_fields: ::protobuf::UnknownFields, + pub cached_size: ::protobuf::CachedSize, +} + +impl<'a> ::std::default::Default for &'a Input { + fn default() -> &'a Input { + ::default_instance() + } +} + +#[derive(Clone,PartialEq,Debug)] +pub enum Input_oneof__artifact { + artifact(Artifact), +} + +impl Input { + pub fn new() -> Input { + ::std::default::Default::default() + } + + // .dev.sigstore.trustroot.v1.TrustedRoot artifact_trust_root = 1; + + + pub fn get_artifact_trust_root(&self) -> &super::sigstore_trustroot::TrustedRoot { + self.artifact_trust_root.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_artifact_trust_root(&mut self) { + self.artifact_trust_root.clear(); + } + + pub fn has_artifact_trust_root(&self) -> bool { + self.artifact_trust_root.is_some() + } + + // Param is passed by value, moved + pub fn set_artifact_trust_root(&mut self, v: super::sigstore_trustroot::TrustedRoot) { + self.artifact_trust_root = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_artifact_trust_root(&mut self) -> &mut super::sigstore_trustroot::TrustedRoot { + if self.artifact_trust_root.is_none() { + self.artifact_trust_root.set_default(); + } + self.artifact_trust_root.as_mut().unwrap() + } + + // Take field + pub fn take_artifact_trust_root(&mut self) -> super::sigstore_trustroot::TrustedRoot { + self.artifact_trust_root.take().unwrap_or_else(|| super::sigstore_trustroot::TrustedRoot::new()) + } + + // .dev.sigstore.verification.v1.ArtifactVerificationOptions artifact_verification_options = 2; + + + pub fn get_artifact_verification_options(&self) -> &ArtifactVerificationOptions { + self.artifact_verification_options.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_artifact_verification_options(&mut self) { + self.artifact_verification_options.clear(); + } + + pub fn has_artifact_verification_options(&self) -> bool { + self.artifact_verification_options.is_some() + } + + // Param is passed by value, moved + pub fn set_artifact_verification_options(&mut self, v: ArtifactVerificationOptions) { + self.artifact_verification_options = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_artifact_verification_options(&mut self) -> &mut ArtifactVerificationOptions { + if self.artifact_verification_options.is_none() { + self.artifact_verification_options.set_default(); + } + self.artifact_verification_options.as_mut().unwrap() + } + + // Take field + pub fn take_artifact_verification_options(&mut self) -> ArtifactVerificationOptions { + self.artifact_verification_options.take().unwrap_or_else(|| ArtifactVerificationOptions::new()) + } + + // .dev.sigstore.bundle.v1.Bundle bundle = 3; + + + pub fn get_bundle(&self) -> &super::sigstore_bundle::Bundle { + self.bundle.as_ref().unwrap_or_else(|| ::default_instance()) + } + pub fn clear_bundle(&mut self) { + self.bundle.clear(); + } + + pub fn has_bundle(&self) -> bool { + self.bundle.is_some() + } + + // Param is passed by value, moved + pub fn set_bundle(&mut self, v: super::sigstore_bundle::Bundle) { + self.bundle = ::protobuf::SingularPtrField::some(v); + } + + // Mutable pointer to the field. + // If field is not initialized, it is initialized with default value first. + pub fn mut_bundle(&mut self) -> &mut super::sigstore_bundle::Bundle { + if self.bundle.is_none() { + self.bundle.set_default(); + } + self.bundle.as_mut().unwrap() + } + + // Take field + pub fn take_bundle(&mut self) -> super::sigstore_bundle::Bundle { + self.bundle.take().unwrap_or_else(|| super::sigstore_bundle::Bundle::new()) + } + + // .dev.sigstore.verification.v1.Artifact artifact = 4; + + + pub fn get_artifact(&self) -> &Artifact { + match self._artifact { + ::std::option::Option::Some(Input_oneof__artifact::artifact(ref v)) => v, + _ => ::default_instance(), + } + } + pub fn clear_artifact(&mut self) { + self._artifact = ::std::option::Option::None; + } + + pub fn has_artifact(&self) -> bool { + match self._artifact { + ::std::option::Option::Some(Input_oneof__artifact::artifact(..)) => true, + _ => false, + } + } + + // Param is passed by value, moved + pub fn set_artifact(&mut self, v: Artifact) { + self._artifact = ::std::option::Option::Some(Input_oneof__artifact::artifact(v)) + } + + // Mutable pointer to the field. + pub fn mut_artifact(&mut self) -> &mut Artifact { + if let ::std::option::Option::Some(Input_oneof__artifact::artifact(_)) = self._artifact { + } else { + self._artifact = ::std::option::Option::Some(Input_oneof__artifact::artifact(Artifact::new())); + } + match self._artifact { + ::std::option::Option::Some(Input_oneof__artifact::artifact(ref mut v)) => v, + _ => panic!(), + } + } + + // Take field + pub fn take_artifact(&mut self) -> Artifact { + if self.has_artifact() { + match self._artifact.take() { + ::std::option::Option::Some(Input_oneof__artifact::artifact(v)) => v, + _ => panic!(), + } + } else { + Artifact::new() + } + } +} + +impl ::protobuf::Message for Input { + fn is_initialized(&self) -> bool { + for v in &self.artifact_trust_root { + if !v.is_initialized() { + return false; + } + }; + for v in &self.artifact_verification_options { + if !v.is_initialized() { + return false; + } + }; + for v in &self.bundle { + if !v.is_initialized() { + return false; + } + }; + if let Some(Input_oneof__artifact::artifact(ref v)) = self._artifact { + if !v.is_initialized() { + return false; + } + } + true + } + + fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> { + while !is.eof()? { + let (field_number, wire_type) = is.read_tag_unpack()?; + match field_number { + 1 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.artifact_trust_root)?; + }, + 2 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.artifact_verification_options)?; + }, + 3 => { + ::protobuf::rt::read_singular_message_into(wire_type, is, &mut self.bundle)?; + }, + 4 => { + if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited { + return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type)); + } + self._artifact = ::std::option::Option::Some(Input_oneof__artifact::artifact(is.read_message()?)); + }, + _ => { + ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?; + }, + }; + } + ::std::result::Result::Ok(()) + } + + // Compute sizes of nested messages + #[allow(unused_variables)] + fn compute_size(&self) -> u32 { + let mut my_size = 0; + if let Some(ref v) = self.artifact_trust_root.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.artifact_verification_options.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let Some(ref v) = self.bundle.as_ref() { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + } + if let ::std::option::Option::Some(ref v) = self._artifact { + match v { + &Input_oneof__artifact::artifact(ref v) => { + let len = v.compute_size(); + my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; + }, + }; + } + my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields()); + self.cached_size.set(my_size); + my_size + } + + fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> { + if let Some(ref v) = self.artifact_trust_root.as_ref() { + os.write_tag(1, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.artifact_verification_options.as_ref() { + os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let Some(ref v) = self.bundle.as_ref() { + os.write_tag(3, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + } + if let ::std::option::Option::Some(ref v) = self._artifact { + match v { + &Input_oneof__artifact::artifact(ref v) => { + os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; + os.write_raw_varint32(v.get_cached_size())?; + v.write_to_with_cached_sizes(os)?; + }, + }; + } + os.write_unknown_fields(self.get_unknown_fields())?; + ::std::result::Result::Ok(()) + } + + fn get_cached_size(&self) -> u32 { + self.cached_size.get() + } + + fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { + &self.unknown_fields + } + + fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { + &mut self.unknown_fields + } + + fn as_any(&self) -> &dyn (::std::any::Any) { + self as &dyn (::std::any::Any) + } + fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) { + self as &mut dyn (::std::any::Any) + } + fn into_any(self: ::std::boxed::Box) -> ::std::boxed::Box { + self + } + + fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { + Self::descriptor_static() + } + + fn new() -> Input { + Input::new() + } + + fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor { + static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT; + descriptor.get(|| { + let mut fields = ::std::vec::Vec::new(); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "artifact_trust_root", + |m: &Input| { &m.artifact_trust_root }, + |m: &mut Input| { &mut m.artifact_trust_root }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "artifact_verification_options", + |m: &Input| { &m.artifact_verification_options }, + |m: &mut Input| { &mut m.artifact_verification_options }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage>( + "bundle", + |m: &Input| { &m.bundle }, + |m: &mut Input| { &mut m.bundle }, + )); + fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, Artifact>( + "artifact", + Input::has_artifact, + Input::get_artifact, + )); + ::protobuf::reflect::MessageDescriptor::new_pb_name::( + "Input", + fields, + file_descriptor_proto() + ) + }) + } + + fn default_instance() -> &'static Input { + static instance: ::protobuf::rt::LazyV2 = ::protobuf::rt::LazyV2::INIT; + instance.get(Input::new) + } +} + +impl ::protobuf::Clear for Input { + fn clear(&mut self) { + self.artifact_trust_root.clear(); + self.artifact_verification_options.clear(); + self.bundle.clear(); + self._artifact = ::std::option::Option::None; + self.unknown_fields.clear(); + } +} + +impl ::std::fmt::Debug for Input { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + ::protobuf::text_format::fmt(self, f) + } +} + +impl ::protobuf::reflect::ProtobufValue for Input { + fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { + ::protobuf::reflect::ReflectValueRef::Message(self) + } +} + +static file_descriptor_proto_data: &'static [u8] = b"\ + \n\x1bsigstore_verification.proto\x12\x1cdev.sigstore.verification.v1\ + \x1a\x15sigstore_common.proto\x1a\x18sigstore_trustroot.proto\x1a\x15sig\ + store_bundle.proto\"\xb6\x01\n\x13CertificateIdentity\x12\x16\n\x06issue\ + r\x18\x01\x20\x01(\tR\x06issuer\x12@\n\x03san\x18\x02\x20\x01(\x0b2..dev\ + .sigstore.common.v1.SubjectAlternativeNameR\x03san\x12E\n\x04oids\x18\ + \x03\x20\x03(\x0b21.dev.sigstore.common.v1.ObjectIdentifierValuePairR\ + \x04oids\"j\n\x15CertificateIdentities\x12Q\n\nidentities\x18\x01\x20\ + \x03(\x0b21.dev.sigstore.verification.v1.CertificateIdentityR\nidentitie\ + s\"Y\n\x13PublicKeyIdentities\x12B\n\x0bpublic_keys\x18\x01\x20\x03(\x0b\ + 2!.dev.sigstore.common.v1.PublicKeyR\npublicKeys\"\xc3\x07\n\x1bArtifact\ + VerificationOptions\x12l\n\x16certificate_identities\x18\x01\x20\x01(\ + \x0b23.dev.sigstore.verification.v1.CertificateIdentitiesH\0R\x15certifi\ + cateIdentities\x12T\n\x0bpublic_keys\x18\x02\x20\x01(\x0b21.dev.sigstore\ + .verification.v1.PublicKeyIdentitiesH\0R\npublicKeys\x12m\n\x0ctlog_opti\ + ons\x18\x03\x20\x01(\x0b2E.dev.sigstore.verification.v1.ArtifactVerifica\ + tionOptions.TlogOptionsH\x01R\x0btlogOptions\x88\x01\x01\x12p\n\rctlog_o\ + ptions\x18\x04\x20\x01(\x0b2F.dev.sigstore.verification.v1.ArtifactVerif\ + icationOptions.CtlogOptionsH\x02R\x0cctlogOptions\x88\x01\x01\x12y\n\x0b\ + tsa_options\x18\x05\x20\x01(\x0b2S.dev.sigstore.verification.v1.Artifact\ + VerificationOptions.TimestampAuthorityOptionsH\x03R\ntsaOptions\x88\x01\ + \x01\x1a\x85\x01\n\x0bTlogOptions\x12\x1c\n\tthreshold\x18\x01\x20\x01(\ + \x05R\tthreshold\x12>\n\x1bperform_online_verification\x18\x02\x20\x01(\ + \x08R\x19performOnlineVerification\x12\x18\n\x07disable\x18\x03\x20\x01(\ + \x08R\x07disable\x1ai\n\x0cCtlogOptions\x12\x1c\n\tthreshold\x18\x01\x20\ + \x01(\x05R\tthreshold\x12!\n\x0cdetached_sct\x18\x02\x20\x01(\x08R\x0bde\ + tachedSct\x12\x18\n\x07disable\x18\x03\x20\x01(\x08R\x07disable\x1aS\n\ + \x19TimestampAuthorityOptions\x12\x1c\n\tthreshold\x18\x01\x20\x01(\x05R\ + \tthreshold\x12\x18\n\x07disable\x18\x02\x20\x01(\x08R\x07disableB\t\n\ + \x07signersB\x0f\n\r_tlog_optionsB\x10\n\x0e_ctlog_optionsB\x0e\n\x0c_ts\ + a_options\"U\n\x08Artifact\x12#\n\x0cartifact_uri\x18\x01\x20\x01(\tH\0R\ + \x0bartifactUri\x12\x1c\n\x08artifact\x18\x02\x20\x01(\x0cH\0R\x08artifa\ + ctB\x06\n\x04data\"\xec\x02\n\x05Input\x12V\n\x13artifact_trust_root\x18\ + \x01\x20\x01(\x0b2&.dev.sigstore.trustroot.v1.TrustedRootR\x11artifactTr\ + ustRoot\x12}\n\x1dartifact_verification_options\x18\x02\x20\x01(\x0b29.d\ + ev.sigstore.verification.v1.ArtifactVerificationOptionsR\x1bartifactVeri\ + ficationOptions\x126\n\x06bundle\x18\x03\x20\x01(\x0b2\x1e.dev.sigstore.\ + bundle.v1.BundleR\x06bundle\x12G\n\x08artifact\x18\x04\x20\x01(\x0b2&.de\ + v.sigstore.verification.v1.ArtifactH\0R\x08artifact\x88\x01\x01B\x0b\n\t\ + _artifactBw\n\"dev.sigstore.proto.verification.v1B\x11VerificationProtoP\ + \x01Z = ::protobuf::rt::LazyV2::INIT; + +fn parse_descriptor_proto() -> ::protobuf::descriptor::FileDescriptorProto { + ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() +} + +pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { + file_descriptor_proto_lazy.get(|| { + parse_descriptor_proto() + }) +}