diff --git a/.github/workflows/rust-x509-example.yml b/.github/workflows/rust-x509-example.yml deleted file mode 100644 index 813d423c40..0000000000 --- a/.github/workflows/rust-x509-example.yml +++ /dev/null @@ -1,45 +0,0 @@ -# Known failure: https://dfinity.atlassian.net/browse/EM-7 -name: rust-x509 -on: - push: - branches: - - master - pull_request: - paths: - - rust/x509/** - - .github/workflows/provision-darwin.sh - - .github/workflows/provision-linux.sh - - .github/workflows/provision-pocket-ic-server.sh - - .github/workflows/rust-x509-example.yml -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true -jobs: - rust-x509-darwin: - runs-on: macos-15 - steps: - - uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0 - - name: Provision Darwin - run: bash .github/workflows/provision-darwin.sh - - name: Provision PocketIC - run: bash .github/workflows/provision-pocket-ic-server.sh - - name: Rust X.509 Darwin - run: | - brew install openssl - pushd rust/x509 - dfx build --check - cargo test - rust-x509-linux: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1.2.0 - - name: Provision Linux - run: bash .github/workflows/provision-linux.sh - - name: Provision PocketIC - run: bash .github/workflows/provision-pocket-ic-server.sh - - name: Rust X.509 Linux - run: | - sudo apt-get install --yes openssl - pushd rust/x509 - dfx build --check - cargo test diff --git a/.github/workflows/x509.yml b/.github/workflows/x509.yml new file mode 100644 index 0000000000..508f3c6925 --- /dev/null +++ b/.github/workflows/x509.yml @@ -0,0 +1,28 @@ +name: x509 + +on: + push: + branches: [master] + pull_request: + paths: + - rust/x509/** + - .github/workflows/x509.yml + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + rust-x509: + runs-on: ubuntu-24.04 + container: ghcr.io/dfinity/icp-dev-env-rust:1.0.0 + env: + ICP_CLI_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: Deploy and test + working-directory: rust/x509 + run: | + icp network start -d + icp deploy + make test diff --git a/rust/x509/.devcontainer/devcontainer.json b/rust/x509/.devcontainer/devcontainer.json deleted file mode 100644 index ebb0b8bcc6..0000000000 --- a/rust/x509/.devcontainer/devcontainer.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "ICP Dev Environment", - "image": "ghcr.io/dfinity/icp-dev-env-slim:22", - "forwardPorts": [4943, 5173], - "portsAttributes": { - "4943": { - "label": "dfx", - "onAutoForward": "ignore" - }, - "5173": { - "label": "vite", - "onAutoForward": "openBrowser" - } - }, - "customizations": { - "vscode": { - "extensions": ["dfinity-foundation.vscode-motoko"] - } - } -} diff --git a/rust/x509/BUILD.md b/rust/x509/BUILD.md deleted file mode 100644 index 24cfcb7547..0000000000 --- a/rust/x509/BUILD.md +++ /dev/null @@ -1,113 +0,0 @@ -# Continue building locally - -Projects deployed through ICP Ninja are temporary; they will only be live for 20 minutes before they are removed. The command-line tool `dfx` can be used to continue building your ICP Ninja project locally and deploy it to the mainnet. - -To migrate your ICP Ninja project off of the web browser and develop it locally, follow these steps. - -### 1. Install developer tools. - -You can install the developer tools natively or use Dev Containers. - -#### Option 1: Natively install developer tools - -> Installing `dfx` natively is currently only supported on macOS and Linux systems. On Windows, it is recommended to use the Dev Containers option. - -1. Install `dfx` with the following command: - -``` - -sh -ci "$(curl -fsSL https://internetcomputer.org/install.sh)" - -``` - -> On Apple Silicon (e.g., Apple M1 chip), make sure you have Rosetta installed (`softwareupdate --install-rosetta`). - -2. [Install NodeJS](https://nodejs.org/en/download/package-manager). - -3. For Rust projects, you will also need to: - -- Install [Rust](https://doc.rust-lang.org/cargo/getting-started/installation.html#install-rust-and-cargo): `curl https://sh.rustup.rs -sSf | sh` - -- Install [candid-extractor](https://crates.io/crates/candid-extractor): `cargo install candid-extractor` - -4. For Motoko projects, you will also need to: - -- Install the Motoko package manager [Mops](https://docs.mops.one/quick-start#2-install-mops-cli): `npm i -g ic-mops` - -Lastly, navigate into your project's directory that you downloaded from ICP Ninja. - -#### Option 2: Dev Containers - -Continue building your projects locally by installing the [Dev Container extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) for VS Code and [Docker](https://docs.docker.com/engine/install/). - -Make sure Docker is running, then navigate into your project's directory that you downloaded from ICP Ninja and start the Dev Container by selecting `Dev-Containers: Reopen in Container` in VS Code's command palette (F1 or Ctrl/Cmd+Shift+P). - -> Note that local development ports (e.g. the ports used by `dfx` or `vite`) are forwarded from the Dev Container to your local machine. In the VS code terminal, use Ctrl/Cmd+Click on the displayed local URLs to open them in your browser. To view the current port mappings, click the "Ports" tab in the VS Code terminal window. - -### 2. Start the local development environment. - -``` -dfx start --background -``` - -### 3. Create a local developer identity. - -To manage your project's canisters, it is recommended that you create a local [developer identity](https://internetcomputer.org/docs/building-apps/getting-started/identities) rather than use the `dfx` default identity that is not stored securely. - -To create a new identity, run the commands: - -``` - -dfx identity new IDENTITY_NAME - -dfx identity use IDENTITY_NAME - -``` - -Replace `IDENTITY_NAME` with your preferred identity name. The first command `dfx start --background` starts the local `dfx` processes, then `dfx identity new` will create a new identity and return your identity's seed phase. Be sure to save this in a safe, secure location. - -The third command `dfx identity use` will tell `dfx` to use your new identity as the active identity. Any canister smart contracts created after running `dfx identity use` will be owned and controlled by the active identity. - -Your identity will have a principal ID associated with it. Principal IDs are used to identify different entities on ICP, such as users and canisters. - -[Learn more about ICP developer identities](https://internetcomputer.org/docs/building-apps/getting-started/identities). - -### 4. Deploy the project locally. - -Deploy your project to your local developer environment with: - -``` -npm install -dfx deploy - -``` - -Your project will be hosted on your local machine. The local canister URLs for your project will be shown in the terminal window as output of the `dfx deploy` command. You can open these URLs in your web browser to view the local instance of your project. - -### 5. Obtain cycles. - -To deploy your project to the mainnet for long-term public accessibility, first you will need [cycles](https://internetcomputer.org/docs/building-apps/getting-started/tokens-and-cycles). Cycles are used to pay for the resources your project uses on the mainnet, such as storage and compute. - -> This cost model is known as ICP's [reverse gas model](https://internetcomputer.org/docs/building-apps/essentials/gas-cost), where developers pay for their project's gas fees rather than users pay for their own gas fees. This model provides an enhanced end user experience since they do not need to hold tokens or sign transactions when using a dapp deployed on ICP. - -> Learn how much a project may cost by using the [pricing calculator](https://internetcomputer.org/docs/building-apps/essentials/cost-estimations-and-examples). - -Cycles can be obtained through [converting ICP tokens into cycles using `dfx`](https://internetcomputer.org/docs/building-apps/developer-tools/dfx/dfx-cycles#dfx-cycles-convert). - -### 6. Deploy to the mainnet. - -Once you have cycles, run the command: - -``` - -dfx deploy --network ic - -``` - -After your project has been deployed to the mainnet, it will continuously require cycles to pay for the resources it uses. You will need to [top up](https://internetcomputer.org/docs/building-apps/canister-management/topping-up) your project's canisters or set up automatic cycles management through a service such as [CycleOps](https://cycleops.dev/). - -> If your project's canisters run out of cycles, they will be removed from the network. - -## Additional examples - -Additional code examples and sample applications can be found in the [DFINITY examples repo](https://github.com/dfinity/examples). diff --git a/rust/x509/Cargo.lock b/rust/x509/Cargo.lock index 93fecbc2c3..7a6c95ed0a 100644 --- a/rust/x509/Cargo.lock +++ b/rust/x509/Cargo.lock @@ -1,68 +1,58 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] -name = "addr2line" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler2" -version = "2.0.0" +name = "anyhow" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" [[package]] -name = "aho-corasick" -version = "1.1.3" +name = "ar_archive_writer" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "4087686b4b0a3427190bae57a1d9a478dbb2d40c5dc1bd6e2b6d797913bdd348" dependencies = [ - "memchr", + "object", ] -[[package]] -name = "anyhow" -version = "1.0.93" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" - [[package]] name = "arrayvec" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" -version = "1.4.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] -name = "backtrace" -version = "0.3.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +name = "backend" +version = "0.1.0" dependencies = [ - "addr2line", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", - "windows-targets", + "candid", + "der", + "ecdsa", + "ed25519", + "ed25519-dalek", + "elliptic-curve", + "getrandom", + "hex", + "ic-cdk", + "ic-cdk-management-canister", + "k256", + "pkcs8", + "serde", + "serde_bytes", + "sha2", + "signature", + "spki", + "strum", + "strum_macros", + "x509-cert", ] [[package]] @@ -71,23 +61,11 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - [[package]] name = "base64ct" -version = "1.6.0" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "binread" @@ -112,12 +90,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - [[package]] name = "block-buffer" version = "0.10.4" @@ -127,29 +99,17 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bumpalo" -version = "3.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" - [[package]] name = "byteorder" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "bytes" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" - [[package]] name = "candid" -version = "0.10.4" +version = "0.10.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd70c7bed52cb20e38dd933c19c0c9abf0302b60db3fa3186e27ec53edf6ad" +checksum = "f8f781afa4a1303e3eab4ada0720a874942bcfa936ce01b816ac6378945c43a9" dependencies = [ "anyhow", "binread", @@ -170,36 +130,31 @@ dependencies = [ [[package]] name = "candid_derive" -version = "0.6.6" +version = "0.10.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3de398570c386726e7a59d9887b68763c481477f9a043fb998a2e09d428df1a9" +checksum = "ad6ae8e7944dd0035651bc0e7b3a3e4cb16f5fc43f8ae4fd76b36ff2cd52759f" dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.118", ] [[package]] name = "cc" -version = "1.2.1" +version = "1.2.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "dad887fd958be91b5098c0248def011f4523ab786cd411be668777e55063501f" dependencies = [ + "find-msvc-tools", "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.2.1" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "const-oid" @@ -207,55 +162,24 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" - [[package]] name = "cpufeatures" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - [[package]] name = "crypto-bigint" version = "0.5.5" @@ -302,20 +226,54 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.118", +] + +[[package]] +name = "darling" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25ae13da2f202d56bd7f91c25fba009e7717a1e4a1cc98a76d844b65ae912e9d" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9865a50f7c335f53564bb694ef660825eb8610e0a53d3e11bf1b0d3df31e03b0" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.118", +] + +[[package]] +name = "darling_macro" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3984ec7bd6cfa798e62b4a642426a5be0e68f9401cfc2a01e3fa9ea2fcdb8d" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.118", ] [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" [[package]] name = "der" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", "der_derive", @@ -332,16 +290,7 @@ checksum = "8034092389675178f570469e6c3b0465d3d30b4505c294a6550db47f3c17ad18" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", -] - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", + "syn 2.0.118", ] [[package]] @@ -356,23 +305,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "dyn-clone" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" - [[package]] name = "ecdsa" version = "0.16.9" @@ -399,9 +331,9 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" dependencies = [ "curve25519-dalek", "ed25519", @@ -413,9 +345,9 @@ dependencies = [ [[package]] name = "either" -version = "1.13.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "elliptic-curve" @@ -437,26 +369,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "equivalent" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" - -[[package]] -name = "erased-serde" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" -dependencies = [ - "serde", -] - [[package]] name = "ff" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ "rand_core", "subtle", @@ -469,108 +386,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] -name = "flagset" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3ea1ec5f8307826a5b71094dd91fc04d4ae75d5709b20ad351c7fb4815c86ec" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-io" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" - -[[package]] -name = "futures-macro" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" +name = "find-msvc-tools" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] -name = "futures-util" -version = "0.3.31" +name = "flagset" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] +checksum = "b7ac824320a75a52197e8f2d787f6a38b6718bb6897a35142d749af3c0e8f4fe" [[package]] name = "generic-array" -version = "0.14.7" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" dependencies = [ "typenum", "version_check", @@ -579,23 +410,15 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", - "js-sys", "libc", "wasi", - "wasm-bindgen", ] -[[package]] -name = "gimli" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" - [[package]] name = "group" version = "0.13.0" @@ -607,51 +430,17 @@ dependencies = [ "subtle", ] -[[package]] -name = "h2" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" - [[package]] name = "heck" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] [[package]] name = "hmac" @@ -663,351 +452,105 @@ dependencies = [ ] [[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" +name = "ic-cdk" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "6a7971f4983db147afbbc4e7f87f60b09fcd60ac707af37ff3d2468dcddbf551" dependencies = [ - "bytes", - "futures-util", - "http", - "http-body", + "candid", + "ic-cdk-executor", + "ic-cdk-macros", + "ic-error-types", + "ic0", "pin-project-lite", + "serde", + "thiserror 2.0.18", ] [[package]] -name = "httparse" -version = "1.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" - -[[package]] -name = "hyper" -version = "1.5.0" +name = "ic-cdk-executor" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "33716b730ded33690b8a704bff3533fda87d229e58046823647d28816e9bcee7" dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", + "ic0", + "slotmap", "smallvec", - "tokio", - "want", ] [[package]] -name = "hyper-rustls" -version = "0.27.3" +name = "ic-cdk-macros" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "a7c20c002200c720958f321bb78b4d4987fc2c380bf9ef69ed4404730810f45f" dependencies = [ - "futures-util", - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-native-certs", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", - "webpki-roots", + "candid", + "darling", + "proc-macro2", + "quote", + "syn 2.0.118", ] [[package]] -name = "hyper-util" -version = "0.1.10" +name = "ic-cdk-management-canister" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "92c1319a274caebf0ab70ab826b8905c29e8563498289356b9a59464f2a85c56" dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", + "candid", + "ic-cdk", + "ic-management-canister-types", + "serde", + "serde_bytes", + "thiserror 2.0.18", ] [[package]] -name = "ic-cdk" -version = "0.13.5" +name = "ic-error-types" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b1da6a25b045f9da3c9459c0cb2b0700ac368ee16382975a17185a23b9c18ab" +checksum = "bbeeb3d91aa179d6496d7293becdacedfc413c825cac79fd54ea1906f003ee55" dependencies = [ - "candid", - "ic-cdk-macros 0.13.2", - "ic0 0.21.1", "serde", - "serde_bytes", + "strum", + "strum_macros", ] [[package]] -name = "ic-cdk" -version = "0.16.0" +name = "ic-management-canister-types" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8ecacd682fa05a985253592963306cb9799622d7b1cce4b1edb89c6ec85be1" +checksum = "51705516ed4d23f24e8d714a70fe9d7ec17106cfd830d5434a1b29f583ef70ee" dependencies = [ "candid", - "ic-cdk-macros 0.16.0", - "ic0 0.23.0", "serde", "serde_bytes", ] [[package]] -name = "ic-cdk-macros" -version = "0.13.2" +name = "ic0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45800053d80a6df839a71aaea5797e723188c0b992618208ca3b941350c7355" -dependencies = [ - "candid", - "proc-macro2", - "quote", - "serde", - "serde_tokenstream 0.1.7", - "syn 1.0.109", -] +checksum = "c77c8932bff1f09502d0d8c079d5a206a06afe523e35e816162cf4d30b5bf80d" [[package]] -name = "ic-cdk-macros" -version = "0.16.0" +name = "ic_principal" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4d857135deef20cc7ea8f3869a30cd9cfeb1392b3a81043790b2cd82adc3e0" +checksum = "1aea751965eaf92990be8c79c64b4f3174ff22dd3604e6696a06a494afbaba2a" dependencies = [ - "candid", - "proc-macro2", - "quote", + "crc32fast", + "data-encoding", "serde", - "serde_tokenstream 0.2.2", - "syn 2.0.87", + "sha2", + "thiserror 1.0.69", ] [[package]] -name = "ic0" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a54b5297861c651551676e8c43df805dad175cc33bc97dbd992edbbb85dcbcdf" - -[[package]] -name = "ic0" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de254dd67bbd58073e23dc1c8553ba12fa1dc610a19de94ad2bbcd0460c067f" - -[[package]] -name = "ic_principal" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1762deb6f7c8d8c2bdee4b6c5a47b60195b74e9b5280faa5ba29692f8e17429c" -dependencies = [ - "crc32fast", - "data-encoding", - "serde", - "sha2", - "thiserror 1.0.69", -] - -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "idna" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "indexmap" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" -dependencies = [ - "equivalent", - "hashbrown", -] - -[[package]] -name = "ipnet" -version = "2.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" - -[[package]] -name = "itoa" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "js-sys" -version = "0.3.72" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" -dependencies = [ - "wasm-bindgen", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "k256" @@ -1031,99 +574,21 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leb128" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" +checksum = "c83bff1d572d6b9aeef67ddfc8448e4a3737909cb28e81f97c791b9018703e52" [[package]] name = "libc" -version = "0.2.162" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" - -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - -[[package]] -name = "lock_api" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" - -[[package]] -name = "matchers" -version = "0.1.0" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "memchr" -version = "2.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.5" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", -] - -[[package]] -name = "mio" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" -dependencies = [ - "hermit-abi", - "libc", - "wasi", - "windows-sys 0.52.0", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] +checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4" [[package]] name = "num-bigint" @@ -1136,12 +601,6 @@ dependencies = [ "serde", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-integer" version = "0.1.46" @@ -1162,1658 +621,457 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "openssl" -version = "0.10.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "pem-rfc7468" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pin-project-lite" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - -[[package]] -name = "pocket-ic" -version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beff607d4dbebff8d003453ced669d2645e905de496ca93713f3d47633357e6c" -dependencies = [ - "base64 0.13.1", - "candid", - "hex", - "ic-cdk 0.13.5", - "reqwest", - "schemars", - "serde", - "serde_bytes", - "serde_json", - "sha2", - "slog", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", -] - -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - -[[package]] -name = "ppv-lite86" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "pretty" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55c4d17d994b637e2f4daf6e5dc5d660d209d5642377d675d7a1c3ab69fa579" -dependencies = [ - "arrayvec", - "typed-arena", - "unicode-width", -] - -[[package]] -name = "proc-macro2" -version = "1.0.89" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "psm" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" -dependencies = [ - "cc", -] - -[[package]] -name = "quinn" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" -dependencies = [ - "bytes", - "pin-project-lite", - "quinn-proto", - "quinn-udp", - "rustc-hash", - "rustls", - "socket2", - "thiserror 2.0.3", - "tokio", - "tracing", -] - -[[package]] -name = "quinn-proto" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" -dependencies = [ - "bytes", - "getrandom", - "rand", - "ring", - "rustc-hash", - "rustls", - "rustls-pki-types", - "slab", - "thiserror 2.0.3", - "tinyvec", - "tracing", - "web-time", -] - -[[package]] -name = "quinn-udp" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" -dependencies = [ - "cfg_aliases", - "libc", - "once_cell", - "socket2", - "tracing", - "windows-sys 0.59.0", -] - -[[package]] -name = "quote" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "redox_syscall" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.9", - "regex-syntax 0.8.5", -] - -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax 0.6.29", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.5", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "reqwest" -version = "0.12.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "mime_guess", - "once_cell", - "percent-encoding", - "pin-project-lite", - "quinn", - "rustls", - "rustls-native-certs", - "rustls-pemfile", - "rustls-pki-types", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tokio-rustls", - "tokio-socks", - "tokio-util", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-streams", - "web-sys", - "webpki-roots", - "windows-registry", -] - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "ring" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" -dependencies = [ - "cc", - "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - -[[package]] -name = "rustc_version" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" -dependencies = [ - "semver", -] - -[[package]] -name = "rustls" -version = "0.23.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" -dependencies = [ - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-native-certs" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "rustls-pki-types", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" -dependencies = [ - "web-time", -] - -[[package]] -name = "rustls-webpki" -version = "0.102.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - -[[package]] -name = "rustversion" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" - -[[package]] -name = "ryu" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" - -[[package]] -name = "schannel" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "schemars" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.87", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "sec1" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" - -[[package]] -name = "serde" -version = "1.0.215" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_bytes" -version = "0.11.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.215" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "serde_json" -version = "1.0.132" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" -dependencies = [ - "itoa", - "memchr", - "ryu", - "serde", -] - -[[package]] -name = "serde_tokenstream" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "797ba1d80299b264f3aac68ab5d12e5825a561749db4df7cd7c8083900c5d4e9" -dependencies = [ - "proc-macro2", - "serde", - "syn 1.0.109", -] - -[[package]] -name = "serde_tokenstream" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64060d864397305347a78851c51588fd283767e7e7589829e8121d65512340f1" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "syn 2.0.87", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -dependencies = [ - "digest", - "rand_core", -] - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - -[[package]] -name = "slog" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8347046d4ebd943127157b94d63abb990fcf729dc4e9978927fdf4ac3c998d06" -dependencies = [ - "erased-serde", -] - -[[package]] -name = "smallvec" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "spki" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - -[[package]] -name = "stacker" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" -dependencies = [ - "cc", - "cfg-if", - "libc", - "psm", - "windows-sys 0.59.0", -] - -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.87", -] - -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" -dependencies = [ - "futures-core", -] - -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" -dependencies = [ - "thiserror-impl 2.0.3", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "itoa", - "num-conv", - "powerfmt", - "serde", - "time-core", - "time-macros", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - -[[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" -dependencies = [ - "num-conv", - "time-core", -] - -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - -[[package]] -name = "tinyvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tls_codec" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e78c9c330f8c85b2bae7c8368f2739157db9991235123aa1b15ef9502bfb6a" -dependencies = [ - "tls_codec_derive", - "zeroize", -] - -[[package]] -name = "tls_codec_derive" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9ef545650e79f30233c0003bcc2504d7efac6dad25fca40744de773fe2049c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "tokio" -version = "1.41.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.52.0", -] - -[[package]] -name = "tokio-macros" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" -dependencies = [ - "rustls", - "rustls-pki-types", - "tokio", -] - -[[package]] -name = "tokio-socks" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4770b8024672c1101b3f6733eab95b18007dbe0847a8afe341fcf79e06043f" -dependencies = [ - "either", - "futures-util", - "thiserror 1.0.69", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - -[[package]] -name = "tracing" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" -dependencies = [ - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-appender" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" -dependencies = [ - "crossbeam-channel", - "thiserror 1.0.69", - "time", - "tracing-subscriber", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", -] - -[[package]] -name = "tracing-core" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" -dependencies = [ - "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", - "tracing-serde", -] - -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - -[[package]] -name = "typed-arena" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unicase" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" - -[[package]] -name = "unicode-ident" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" - -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "url" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - -[[package]] -name = "valuable" -version = "0.1.0" +version = "0.37.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ff76201f031d8863c38aa7f905eca4f53abbfa15f609db4277d44cd8938f33fe" +dependencies = [ + "memchr", +] [[package]] -name = "vcpkg" -version = "0.2.15" +name = "once_cell" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] -name = "version_check" -version = "0.9.5" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "want" -version = "0.3.1" +name = "pem-rfc7468" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" dependencies = [ - "try-lock", + "base64ct", ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "pin-project-lite" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] -name = "wasm-bindgen" -version = "0.2.95" +name = "pkcs8" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "cfg-if", - "once_cell", - "wasm-bindgen-macro", + "der", + "spki", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.95" +name = "pretty" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "0d22152487193190344590e4f30e219cf3fe140d9e7a3fdb683d82aa2c5f4156" dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.87", - "wasm-bindgen-shared", + "arrayvec", + "typed-arena", + "unicode-width", ] [[package]] -name = "wasm-bindgen-futures" -version = "0.4.45" +name = "proc-macro2" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", + "unicode-ident", ] [[package]] -name = "wasm-bindgen-macro" -version = "0.2.95" +name = "psm" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "645dbe486e346d9b5de3ef16ede18c26e6c70ad97418f4874b8b1889d6e761ea" dependencies = [ - "quote", - "wasm-bindgen-macro-support", + "ar_archive_writer", + "cc", ] [[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.95" +name = "quote" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", - "quote", - "syn 2.0.87", - "wasm-bindgen-backend", - "wasm-bindgen-shared", ] [[package]] -name = "wasm-bindgen-shared" -version = "0.2.95" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" - -[[package]] -name = "wasm-streams" -version = "0.4.2" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "futures-util", - "js-sys", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", + "getrandom", ] [[package]] -name = "web-sys" -version = "0.3.72" +name = "rfc6979" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "js-sys", - "wasm-bindgen", + "hmac", + "subtle", ] [[package]] -name = "web-time" -version = "1.1.0" +name = "rustc_version" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "js-sys", - "wasm-bindgen", + "semver", ] [[package]] -name = "webpki-roots" -version = "0.26.6" +name = "rustversion" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" -dependencies = [ - "rustls-pki-types", -] +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" [[package]] -name = "winapi" -version = "0.3.9" +name = "sec1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "semver" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] -name = "windows-registry" -version = "0.2.0" +name = "serde" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" dependencies = [ - "windows-result", - "windows-strings", - "windows-targets", + "serde_core", + "serde_derive", ] [[package]] -name = "windows-result" -version = "0.2.0" +name = "serde_bytes" +version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "a5d440709e79d88e51ac01c4b72fc6cb7314017bb7da9eeff678aa94c10e3ea8" dependencies = [ - "windows-targets", + "serde", + "serde_core", ] [[package]] -name = "windows-strings" -version = "0.1.0" +name = "serde_core" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" dependencies = [ - "windows-result", - "windows-targets", + "serde_derive", ] [[package]] -name = "windows-sys" -version = "0.52.0" +name = "serde_derive" +version = "1.0.228" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ - "windows-targets", + "proc-macro2", + "quote", + "syn 2.0.118", ] [[package]] -name = "windows-sys" -version = "0.59.0" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "windows-targets", + "cfg-if", + "cpufeatures", + "digest", ] [[package]] -name = "windows-targets" -version = "0.52.6" +name = "sha2" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_gnullvm", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "cfg-if", + "cpufeatures", + "digest", ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.6" +name = "shlex" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" [[package]] -name = "windows_aarch64_msvc" -version = "0.52.6" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] [[package]] -name = "windows_i686_gnu" -version = "0.52.6" +name = "slotmap" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +checksum = "bdd58c3c93c3d278ca835519292445cb4b0d4dc59ccfdf7ceadaab3f8aeb4038" +dependencies = [ + "version_check", +] [[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" +name = "smallvec" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] -name = "windows_i686_msvc" -version = "0.52.6" +name = "spki" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.52.6" +name = "stacker" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "640c8cdd92b6b12f5bcb1803ca3bbf5ab96e5e6b6b96b9ab77dabe9e880b3190" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys", +] [[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.6" +name = "strsim" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] -name = "windows_x86_64_msvc" -version = "0.52.6" +name = "strum" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros", +] [[package]] -name = "write16" -version = "1.0.0" +name = "strum_macros" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.118", +] [[package]] -name = "writeable" -version = "0.5.5" +name = "subtle" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] -name = "x509-cert" -version = "0.2.5" +name = "syn" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1301e935010a701ae5f8655edc0ad17c44bad3ac5ce8c39185f75453b720ae94" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "const-oid", - "der", - "sha1", - "signature", - "spki", - "tls_codec", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "x509_example_rust" -version = "0.1.0" +name = "syn" +version = "2.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" dependencies = [ - "candid", - "der", - "ecdsa", - "ed25519", - "ed25519-dalek", - "elliptic-curve", - "getrandom", - "hex", - "ic-cdk 0.16.0", - "k256", - "openssl", - "pkcs8", - "pocket-ic", - "serde", - "serde_bytes", - "sha2", - "signature", - "spki", - "strum", - "strum_macros", - "x509-cert", + "proc-macro2", + "quote", + "unicode-ident", ] [[package]] -name = "yoke" -version = "0.7.4" +name = "thiserror" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", + "thiserror-impl 1.0.69", ] [[package]] -name = "yoke-derive" -version = "0.7.4" +name = "thiserror" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", - "synstructure", + "thiserror-impl 2.0.18", ] [[package]] -name = "zerocopy" -version = "0.7.35" +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "byteorder", - "zerocopy-derive", + "proc-macro2", + "quote", + "syn 2.0.118", ] [[package]] -name = "zerocopy-derive" -version = "0.7.35" +name = "thiserror-impl" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.118", ] [[package]] -name = "zerofrom" -version = "0.1.4" +name = "tls_codec" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "0de2e01245e2bb89d6f05801c564fa27624dbd7b1846859876c7dad82e90bf6b" dependencies = [ - "zerofrom-derive", + "tls_codec_derive", + "zeroize", ] [[package]] -name = "zerofrom-derive" -version = "0.1.4" +name = "tls_codec_derive" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "2d2e76690929402faae40aebdda620a2c0e25dd6d3b9afe48867dfd95991f4bd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", - "synstructure", + "syn 2.0.118", ] [[package]] -name = "zeroize" -version = "1.8.1" +name = "typed-arena" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-width" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "zeroize_derive", + "windows-link", ] [[package]] -name = "zeroize_derive" -version = "1.4.2" +name = "x509-cert" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +checksum = "1301e935010a701ae5f8655edc0ad17c44bad3ac5ce8c39185f75453b720ae94" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.87", + "const-oid", + "der", + "sha1", + "signature", + "spki", + "tls_codec", ] [[package]] -name = "zerovec" -version = "0.10.4" +name = "zeroize" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", + "zeroize_derive", ] [[package]] -name = "zerovec-derive" -version = "0.10.3" +name = "zeroize_derive" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.118", ] diff --git a/rust/x509/Cargo.toml b/rust/x509/Cargo.toml index a9039a2456..dc6548c198 100644 --- a/rust/x509/Cargo.toml +++ b/rust/x509/Cargo.toml @@ -1,11 +1,8 @@ [workspace] -members = [ - "src/x509_example_rust", -] +members = ["backend"] +resolver = "2" [profile.release] lto = true opt-level = 'z' panic = 'abort' - - diff --git a/rust/x509/Makefile b/rust/x509/Makefile new file mode 100644 index 0000000000..914e80662f --- /dev/null +++ b/rust/x509/Makefile @@ -0,0 +1,34 @@ +.PHONY: test + +test: + @echo "=== Test 1: Generate root CA certificate (Ed25519) ===" + @result=$$(icp canister call backend root_ca_certificate '()') && \ + echo "$$result" && \ + echo "$$result" | grep -q 'BEGIN CERTIFICATE' && \ + echo "PASS" || (echo "FAIL" && exit 1) + + @echo "=== Test 2: Root CA certificate is idempotent (cached on second call) ===" + @result=$$(icp canister call backend root_ca_certificate '()') && \ + echo "$$result" && \ + echo "$$result" | grep -q 'BEGIN CERTIFICATE' && \ + echo "PASS" || (echo "FAIL" && exit 1) + + @echo "=== Test 3: Generate and sign a child certificate from an Ed25519 CSR ===" + @openssl genpkey -algorithm Ed25519 -out /tmp/x509_test_key.pem 2>/dev/null && \ + openssl req -new -key /tmp/x509_test_key.pem -out /tmp/x509_test_csr.pem \ + -subj "/CN=Test Corporation/O=Test Inc/C=US" 2>/dev/null && \ + CSR=$$(cat /tmp/x509_test_csr.pem | tr '\n' '\\n' | sed 's/\\n$//') && \ + result=$$(icp canister call backend child_certificate \ + "(record { pem_certificate_request = \"$$CSR\n\" })") && \ + echo "$$result" && \ + echo "$$result" | grep -q 'BEGIN CERTIFICATE' && \ + echo "PASS" || (echo "FAIL" && exit 1) + + @echo "=== Test 4: Verify root CA certificate is self-signed (openssl verify) ===" + @icp canister call backend root_ca_certificate '()' --output json \ + | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['Ok']['x509_certificate_string'])" \ + | sed 's/\\n/\n/g' > /tmp/x509_root_ca.pem && \ + openssl verify -CAfile /tmp/x509_root_ca.pem /tmp/x509_root_ca.pem 2>&1 && \ + echo "PASS" || (echo "FAIL" && exit 1) + + @rm -f /tmp/x509_test_key.pem /tmp/x509_test_csr.pem /tmp/x509_root_ca.pem diff --git a/rust/x509/README.md b/rust/x509/README.md index 75145108f8..11ea552767 100644 --- a/rust/x509/README.md +++ b/rust/x509/README.md @@ -1,449 +1,118 @@ # X.509 -## Overview +A minimal example canister demonstrating two use cases of [X.509](https://en.wikipedia.org/wiki/X.509) certificates on the Internet Computer: -We present a minimal example canister smart contract for showcasing two use -cases of [X.509](https://en.wikipedia.org/wiki/X.509). -1) How to create an X.509 certification authority (CA) certificate, where the CA - certificate's private key is a threshold signing key, which is never revealed - in cleartext, and cannot be revealed due to the properties of the threshold - signature protocols on the Internet Computer. This means that only the - canister can sign child certificates. -2) How to create a child certificate from a certificate signing request (CSR) - provided by an external party. The CSR is generated externally, i.e., with a - private key generated by the caller. +1. How to create an X.509 certification authority (CA) certificate whose private key is a **threshold signing key** — the CA's private key is never revealed in cleartext and cannot be revealed due to the properties of the threshold signature protocols on the Internet Computer. This means that only the canister can sign child certificates. +2. How to create a child certificate from a certificate signing request (CSR) provided by an external party. The CSR is generated externally (i.e. with a private key generated by the caller). -More specifically, the sample canister: +More specifically, the canister: -- Takes a threshold Ed25519 or ECDSA with curve `secp256k1` key name upon - initialization, e.g., `(variant { Ed25519 = variant { TestKey1 } })`. -- Generates a CA certificate via an update call to the `root_ca_certificate` - function. The CA certificate is generated only once and afterwards stored in - the smart contract. -- Generates a child certificate with a CSR provided in the PEM format in an - update call to the `child_certificate` function. -- Note that the derivation path of the key that is used to sign the root - certificate is hard-coded to be empty. +- Takes a threshold Ed25519 or ECDSA with curve `secp256k1` key name upon initialization, e.g. `(variant { Ed25519 = variant { TestKey1 } })`. +- Generates a CA certificate via an update call to the `root_ca_certificate` function. The CA certificate is generated only once and then stored in the canister. +- Generates a child certificate with a CSR provided in PEM format via an update call to the `child_certificate` function. +- Uses an empty derivation path for the key that signs the root certificate. -Currently this canister only produces and accepts certificates with Ed25519 -keys or ECDSA keys using curve `secp256k1`. +Currently this canister only produces and accepts certificates with Ed25519 keys or ECDSA keys using curve `secp256k1`. -This tutorial gives a complete overview of the development, starting with -downloading -[`dfx`](https://internetcomputer.org/docs/current/developer-docs/setup/index.md), -up to the deployment and trying out the code on the mainnet. +## Build and deploy from the command line -## Deploying from ICP Ninja +### Prerequisites -When viewing this project in ICP Ninja, you can deploy it directly to the mainnet for free by clicking "Run" in the upper right corner. Open this project in ICP Ninja: - -[![](https://icp.ninja/assets/open.svg)](https://icp.ninja/i?g=https://github.com/dfinity/examples/rust/x509) - - - -## Deploy and test the canister locally - -- [x] Install the [IC SDK](https://internetcomputer.org/docs/current/developer-docs/getting-started/install) v`0.23.0` or newer. -- [x] Clone the example dapp project: `git clone https://github.com/dfinity/examples` - -Sample code for `x509-example` is provided in the [examples repository](https://github.com/dfinity/examples), under [`/rust`](https://github.com/dfinity/examples/tree/master/rust/x509) sub-directory. +- [Node.js](https://nodejs.org/) +- icp-cli: `npm install -g @icp-sdk/icp-cli @icp-sdk/ic-wasm` +### Install ```bash +git clone https://github.com/dfinity/examples cd examples/rust/x509 -dfx start --background -npm install -dfx deploy ``` -#### What this does -- `dfx start --background` starts a local instance of the IC via the IC SDK - -If successful, you should see something like this: +### Deploy and test ```bash -Deployed canisters. -URLs: - Backend canister via Candid interface: - x509_example: http://127.0.0.1:4943/?canisterId=t6rzw-2iaaa-aaaaa-aaama-cai&id=st75y-vaaaa-aaaaa-aaalq-cai +icp network start -d +icp deploy +make test +icp network stop ``` -If you open the URL in a web browser, you will see a web UI that shows the -public methods the canister exposes. Since the canister exposes -`root_ca_certificate` and `child_certificate` methods, those are rendered in the -web UI. - -## Deploying the canister on the mainnet - -Before deploying this canister to the mainnet, you must do the following: - -- Acquire cycles (equivalent of "gas" in other blockchains). This is necessary for all canisters. -- Update the sample source code to have the right key ID. This is unique to this canister. - -#### Step 1: Acquire cycles to deploy +The canister is initialized with the `Ed25519 / TestKey1` threshold key by default. To deploy with a different key, pass an init argument: -Deploying to the Internet Computer requires [cycles](https://internetcomputer.org/docs/current/developer-docs/getting-started/tokens-and-cycles) (the equivalent of "gas" on other blockchains). - -#### Step 2: Update source code with the right key ID +```bash +icp deploy --argument '(variant { EcdsaSecp256k1 = variant { TestKey1 } })' +``` -To deploy the sample code, the canister needs the right key name for the right -environment. Specifically, one needs to initialize the canister with the key -name. Here, `dfx deploy` will give a choice of key names. +## Key names -There are three options that are supported: +There are three supported key names: -* `dfx_test_key`: a default key ID that is used in deploying to a local version - of IC (via IC SDK). -* `test_key_1`: a master **test** key ID that is used in mainnet. -* `key_1`: a master **production** key ID that is used in mainnet. +- `DfxTestKey` (string: `dfx_test_key`): a default test key used when deploying to a local replica. +- `TestKey1` (string: `test_key_1`): a master **test** key ID used on the mainnet. +- `Key1` (string: `key_1`): a master **production** key ID used on the mainnet. -Note that `dfx deploy` formats those name in `PascalCase` instead of -`snake_case` due to the formatting of types in `rust`. +Note that these names are formatted in `PascalCase` in the Candid variant type due to Rust enum conventions, while the underlying key name strings use `snake_case`. -#### Step 3: Deploy to the mainnet using the IC SDK +## Obtaining the root CA certificate -To [deploy via the mainnet](https://internetcomputer.org/docs/current/developer-docs/setup/deploy-mainnet.md), run the following commands: +### Using the Candid web UI -```bash -npm install -dfx deploy --network ic -``` +After deploying locally, the `icp deploy` output includes a URL to the Candid web UI where you can call `root_ca_certificate` and `child_certificate` directly. -If successful, you should see something like this: +### Using the command line ```bash -Deployed canisters. -URLs: - Backend canister via Candid interface: - schnorr_example_rust: https://a3gq9-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=736w4-cyaaa-aaaal-qb3wq-cai +icp canister call backend root_ca_certificate '()' ``` -In the example above, `x509_example_rust` has the URL https://a3gq9-oaaaa-aaaab-qaa4q-cai.raw.icp0.io/?id=736w4-cyaaa-aaaal-qb3wq-cai and serves up the Candid web UI for this particular canister deployed on mainnet. - -## Obtaining the root CA certificate - -### Using the Candid Web UI - -If you deployed your canister locally or to the mainnet, you should have a URL to the Candid web UI where you can access the public methods. We can call the `root_ca_certificate` method. +Example output: -In the example below, the method returns ``` ------BEGIN CERTIFICATE----- -MIIBxzCCAXmgAwIBAgIBADAFBgMrZXAwazELMAkGA1UEBhMCVVMxKTAnBgNVBAoM -IFdlYjMgY2VyaXRpZmNhdGlvbiBhdXRob3JpdHkgSW5jMTEwLwYDVQQDDChXZWIz -IGNlcnRpZmljYXRpb24gYXV0aG9yaXR5IGNvcnBvcmF0aW9uMB4XDTI0MDkyMDE2 -MzY0MloXDTM0MDkxODE2MzY0MlowazELMAkGA1UEBhMCVVMxKTAnBgNVBAoMIFdl -YjMgY2VyaXRpZmNhdGlvbiBhdXRob3JpdHkgSW5jMTEwLwYDVQQDDChXZWIzIGNl -cnRpZmljYXRpb24gYXV0aG9yaXR5IGNvcnBvcmF0aW9uMCowBQYDK2VwAyEA8rDQ -aKVQyUr1vKqf+PzXNjg+mw3t7RPVPB9ctenyQISjQjBAMB0GA1UdDgQWBBTULvca -cvvKz89izqKDzwWZ6gwdKTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB -BjAFBgMrZXADQQBlqWQ+F757rKxPXDccuhQEtrfnLoWf4rHhok/2dLioJ1+ZQda5 -DNH8/kcXoPOm0jyqlVaV1ZhQm63AMwK3gSwC ------END CERTIFICATE----- -``` -as the -root CA certificate. - -```json ( variant { Ok = record { - x509_certificate_string = "-----BEGIN CERTIFICATE-----\nMIIBxzCCAXmgAwIBAgIBADAFBgMrZXAwazELMAkGA1UEBhMCVVMxKTAnBgNVBAoM\nIFdlYjMgY2VyaXRpZmNhdGlvbiBhdXRob3JpdHkgSW5jMTEwLwYDVQQDDChXZWIz\nIGNlcnRpZmljYXRpb24gYXV0aG9yaXR5IGNvcnBvcmF0aW9uMB4XDTI0MDkyMDE2\nMzY0MloXDTM0MDkxODE2MzY0MlowazELMAkGA1UEBhMCVVMxKTAnBgNVBAoMIFdl\nYjMgY2VyaXRpZmNhdGlvbiBhdXRob3JpdHkgSW5jMTEwLwYDVQQDDChXZWIzIGNl\ncnRpZmljYXRpb24gYXV0aG9yaXR5IGNvcnBvcmF0aW9uMCowBQYDK2VwAyEA8rDQ\naKVQyUr1vKqf+PzXNjg+mw3t7RPVPB9ctenyQISjQjBAMB0GA1UdDgQWBBTULvca\ncvvKz89izqKDzwWZ6gwdKTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB\nBjAFBgMrZXADQQBlqWQ+F757rKxPXDccuhQEtrfnLoWf4rHhok/2dLioJ1+ZQda5\nDNH8/kcXoPOm0jyqlVaV1ZhQm63AMwK3gSwC\n-----END CERTIFICATE-----\n"; + x509_certificate_string = "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----\n"; } }, ) ``` -### Code walkthrough -Open the file `wasm_only.rs`, which will show the following Rust code that -demonstrates how to obtain a root CA certificate. - -#### Obtaining root CA certificate - -```rust -#[update] -async fn root_ca_certificate() -> Result { - // if the certificate is already cached, return it - - if let Some(certificate) = ROOT_CA_CERTIFICATE_PEM.with(|inner| inner.get().map(|v| v.clone())) - { - return Ok(X509CertificateString { - x509_certificate_string: certificate, - }); - } +## Certificate verification with OpenSSL - // if the certificate is not cached, create it and try to cache it - - let serial_number = SerialNumber::from(0u32); - - let subject = Name::from_str( - "CN=DEMO Web3 certification authority corporation,O=DEMO Web3 ceritifcation authority Inc,C=US", - ) - .unwrap(); - - let newly_constructed_x509_certificate_string = match CA_KEY_INFORMATION - .with(|value| *value.borrow()) - { - CaKeyInformation::Ed25519(_) => { - let signer = Ed25519Signer::new() - .await - .map_err(|e| format!("failed to create Ed25519 signer: {e:?}"))?; - - let subject_public_key = - der::asn1::BitString::new(0, root_ca_public_key_bytes().await?) - .map_err(|e| format!("source: {:?}", e.source()))?; - - let pub_key = SubjectPublicKeyInfoOwned { - algorithm: signer.signature_algorithm_identifier().unwrap(), - subject_public_key, - }; - - pem_certificate_signed_by_root_ca( - Profile::Root, - serial_number, - validity(), - subject, - pub_key, - signer, - ) - .await - .map_err(|e| format!("failed to create root certificate: {e:?}"))? - } - CaKeyInformation::EcdsaSecp256k1(_) => { - let signer = EcdsaSecp256k1Signer::new() - .await - .map_err(|e| format!("failed to create ECDSA secp256k1 signer: {e:?}"))?; - - let public_key_bytes_compressed = root_ca_public_key_bytes().await?; - let public_key_bytes_uncompressed = - k256::ecdsa::VerifyingKey::from_sec1_bytes(public_key_bytes_compressed.as_slice()) - .map_err(|e| format!("malformed public key: {e:?}"))? - .to_encoded_point(false); - - let subject_public_key = - der::asn1::BitString::new(0, public_key_bytes_uncompressed.as_bytes()) - .map_err(|e| format!("source: {:?}", e.source()))?; - - let pub_key = SubjectPublicKeyInfoOwned { - algorithm: AlgorithmIdentifier { - // Public Key Algorithm: id-ecPublicKey (1.2.840.10045.2.1) - oid: pkcs8::ObjectIdentifier::new_unwrap("1.2.840.10045.2.1"), - parameters: Some(der::Any::from(k256::Secp256k1::OID)), - }, - subject_public_key, - }; - - pem_certificate_signed_by_root_ca( - Profile::Root, - serial_number, - validity(), - subject, - pub_key, - signer, - ) - .await - .map_err(|e| format!("failed to create root certificate: {e:?}"))? - } - }; - - let x509_certificate_string = ROOT_CA_CERTIFICATE_PEM.with(move |inner| { - inner - .get_or_init(|| newly_constructed_x509_certificate_string) - .clone() - }); - - Ok(X509CertificateString { - x509_certificate_string, - }) -} - -async fn pem_certificate_signed_by_root_ca( - profile: Profile, - serial_number: SerialNumber, - validity: Validity, - subject: Name, - subject_public_key_info: SubjectPublicKeyInfoOwned, - signer: Signer, -) -> Result -where - Signer: Sign, - Signer: Keypair + DynSignatureAlgorithmIdentifier, - Signer::VerifyingKey: EncodePublicKey, -{ - let mut builder = CertificateBuilder::new( - profile, - serial_number, - validity, - subject, - subject_public_key_info, - &signer, - ) - .expect("Create certificate"); - - let blob = builder - .finalize() - .map_err(|e| format!("failed to finalize certificate builder: {e:?}"))?; - - let signature = BitString::from_bytes(&signer.sign(&blob).await?) - .map_err(|e| format!("wrong signature length: {e:?}"))?; - - let certificate = builder - .assemble(signature) - .map_err(|e| format!("failed to assemble certificate: {e:?}"))?; - - certificate - .to_pem(LineEnding::LF) - .map_err(|e| format!("failed to encode certificate: {e:?}")) -} -``` +Save the root CA certificate and verify it is self-signed: -In the code above, the canister calls `root_ca_public_key_bytes` which calls -`schnorr_public_key` method or `ecdsa_public_key` method of the [IC management -canister](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-management-canister) -(`aaaaa-aa`). Then, inside `pem_certificated_signed_by_root_ca`, the canister -calls `sign_with_schnorr` method or `sign_with_ecdsa` method of the IC -management canister inside `Ed25519Signer::sign` or -`EcdsaSecp256k1Signer::sign`, respectively, in order to produce a certificate -signature. More details about `Ed25519Signer` and `EcdsaSecp256k1Signer` can be -found in `wasm_only/signer.rs`. - -**The [IC management -canister](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-management-canister) -is just a facade; it does not exist as a canister (with isolated state, Wasm -code, etc.). It is an ergonomic way for canisters to call the system API of the -IC (as if it were a single canister). In the code below, we use the management -canister to create a Schnorr public key. Canister ID `"aaaaa-aa"` -declares the IC management canister in the canister code.** - -#### Creating a certificate signing request (CSR) and obtaining the signed child certificate - -```rust -#[update] -async fn child_certificate( - certificate_request_info: PemCertificateRequest, -) -> Result { - let cert_req = - CertReq::from_pem(certificate_request_info.pem_certificate_request.as_bytes()) - .map_err(|e| format!("failed to parse PEM certificate signing request: {e:?}"))?; - - verify_certificate_request_signature(&cert_req)?; - - if !cert_req.info.attributes.is_empty() { - return Err("Attributes are currently not supported in this example".to_string()); - } +```bash +icp canister call backend root_ca_certificate '()' --output json \ + | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['Ok']['x509_certificate_string'])" \ + | sed 's/\\n/\n/g' > root_ca_cert.pem - prove_ownership(&cert_req, ic_cdk::api::caller() /*, ... */)?; - - let root_certificate_pem = root_ca_certificate().await?; - let root_certificate = - x509_cert::Certificate::from_pem(root_certificate_pem.x509_certificate_string.as_str()) - .map_err(|e| format!("failed to parse PEM root CA certificate: {e:?}"))?; - - let profile = Profile::Leaf { - issuer: root_certificate.tbs_certificate.subject.clone(), - enable_key_agreement: false, - enable_key_encipherment: false, - }; - - let serial_number = SerialNumber::from(next_child_certificate_serial_number()); - - // For simplicity of this example, let's just use the same validity - // period as the root certificate. In a real application, the validity - // would normally not start in the past and might end well before the root - // certificate validity ends. Also, the validity of the child - // ceritifcate should always be in the time frame of the root - // certificate's validity. - let validity = root_certificate.tbs_certificate.validity.clone(); - - let x509_certificate_string = { - match CA_KEY_INFORMATION.with(|value| *value.borrow()) { - CaKeyInformation::Ed25519(_) => { - let signer = Ed25519Signer::new() - .await - .map_err(|e| format!("failed to create Ed25519 signer: {e:?}"))?; - pem_certificate_signed_by_root_ca( - profile, - serial_number, - validity, - cert_req.info.subject.clone(), - cert_req.info.public_key.clone(), - signer, - ) - .await - .map_err(|e| format!("failed to create child certificate: {e:?}"))? - } - CaKeyInformation::EcdsaSecp256k1(_) => { - let signer = EcdsaSecp256k1Signer::new() - .await - .map_err(|e| format!("failed to create Ed25519 signer: {e:?}"))?; - pem_certificate_signed_by_root_ca( - profile, - serial_number, - validity, - cert_req.info.subject.clone(), - cert_req.info.public_key.clone(), - signer, - ) - .await - .map_err(|e| format!("failed to create child certificate: {e:?}"))? - } - } - }; - - Ok(X509CertificateString { - x509_certificate_string, - }) -} +openssl verify -CAfile root_ca_cert.pem root_ca_cert.pem ``` -Similarly to the root CA certificate, child certificates are signed via the -`pem_certificate_signed_by_root_ca` function. The major difference here is that -the meta-information about the certificate such as subject and public key -information are provided via a -[CSR](https://en.wikipedia.org/wiki/Certificate_signing_request) in the PKCS#10 -format, which is the most widely-used CSR format and can be generate e.g. using -OpenSSL. - -The `child_certificate` API allows for an external user to generate a key pair -locally, create a CSR, send it in the PEM format to the smart contract, and get -a X.509 certificate for the CSR, signed with the key of the CA certificate. +To create a CSR and obtain a signed child certificate: -Note that, similarly to CA certificates, currently only Ed25519 and ECDSA with -curve `secp256k1` are supported for child certificates, i.e., also for CSRs. - -## Certificate verification - -Certificates obtained from the smart contract can be validated e.g. using -OpenSSL. - -To validate the root CA certificate from a locally deployed smart contract, the -following command can be used. -```shell -dfx canister call x509_example_rust root_ca_certificate --output json | jq '.["Ok"].["x509_certificate_string"]' | sed -e 's/\\n/\n/g' -e 's/\"//g' > root_ca_cert.pem && openssl verify -CAfile root_ca_cert.pem root_ca_cert.pem -``` - -To create a CSR, the following script could be used. -```shell +```bash openssl genpkey -algorithm Ed25519 -out key.pem -openssl req -new -key key.pem -out request.csr -subj "/CN=Test corporation/O=Test Inc/C=US" -``` +openssl req -new -key key.pem -out request.csr -subj "/CN=Test Corporation/O=Test Inc/C=US" -To validate a child certificate, the following command could be used. -```shell CSR=$(cat request.csr) -dfx canister call x509_example_rust child_certificate "(record { pem_certificate_request = \"$CSR\"; } )" --output json | jq '.["Ok"].["x509_certificate_string"]' | sed -e 's/\\n/\n/g' -e 's/\"//g' > child_cert.pem && +icp canister call backend child_certificate \ + "(record { pem_certificate_request = \"$CSR\" })" \ + --output json \ + | python3 -c "import sys,json; d=json.load(sys.stdin); print(d['Ok']['x509_certificate_string'])" \ + | sed 's/\\n/\n/g' > child_cert.pem + openssl verify -CAfile root_ca_cert.pem child_cert.pem ``` -## Conclusion +## How it works + +The canister calls the [`schnorr_public_key`](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-management-canister) or [`ecdsa_public_key`](https://internetcomputer.org/docs/current/references/ic-interface-spec/#ic-management-canister) method of the IC management canister to retrieve the public key, then calls `sign_with_schnorr` or `sign_with_ecdsa` inside the signer implementations (`Ed25519Signer` / `EcdsaSecp256k1Signer`) to produce a certificate signature. The management canister is a facade — it does not exist as a canister with isolated state; it is an ergonomic way for canisters to call IC system APIs. + +Both the root CA public key and the generated certificate are cached in canister memory so that subsequent calls do not trigger additional threshold signing rounds. -In this walkthrough, we deployed a sample smart contract that: +The `child_certificate` API lets an external user generate a key pair locally, create a CSR, send it in PEM (PKCS#10) format to the canister, and receive an X.509 certificate signed by the CA key. Note that only Ed25519 and ECDSA `secp256k1` keys are supported for CSRs. -* Generated a root CA certificated self-signed with private Ed25519 keys even - though **canisters do not hold Schnorr keys themselves**. -* Requested child certificate signed with the private Ed25519 key of the root CA - certificate. - ## Security considerations and best practices -If you base your application on this example, it is recommended that you familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/building-apps/security/overview) for developing on ICP. This example may not implement all the best practices. +If you base your application on this example, familiarize yourself with and adhere to the [security best practices](https://internetcomputer.org/docs/building-apps/security/overview) for developing on ICP. This example may not implement all the best practices. diff --git a/rust/x509/src/x509_example_rust/Cargo.toml b/rust/x509/backend/Cargo.toml similarity index 79% rename from rust/x509/src/x509_example_rust/Cargo.toml rename to rust/x509/backend/Cargo.toml index b45993dae8..685c337d49 100644 --- a/rust/x509/src/x509_example_rust/Cargo.toml +++ b/rust/x509/backend/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "x509_example_rust" +name = "backend" version = "0.1.0" -edition = "2018" +edition = "2021" [lib] path = "src/lib.rs" -crate-type = ["lib", "cdylib"] +crate-type = ["cdylib"] [dependencies] -candid = "=0.10.4" +candid = "0.10" der = { version = "0.7.9", features = ["alloc", "derive", "flagset", "oid"] } ecdsa = { version = "0.16.9", features = ["alloc", "pkcs8", "pem"] } ed25519 = { version = "2.2.3", features = ["alloc", "pkcs8", "pem"] } @@ -16,7 +16,8 @@ ed25519-dalek = { version = "2.1.1" } elliptic-curve = { version = "0.13.8", features = ["pkcs8"] } getrandom = { version = "0.2", features = ["custom"] } hex = "0.4" -ic-cdk = "0.16" +ic-cdk = "0.20" +ic-cdk-management-canister = "0.1.1" k256 = "0.13.3" pkcs8 = "0.10.2" sha2 = "0.10" @@ -27,7 +28,3 @@ spki = "0.7.3" strum = "0.26.3" strum_macros = "0.26.3" x509-cert = { version = "0.2.5", features = ["builder"] } - -[dev-dependencies] -openssl = "0.10.66" -pocket-ic = "5.0.0" diff --git a/rust/x509/src/x509_example_rust/src/all_architectures.rs b/rust/x509/backend/src/all_architectures.rs similarity index 100% rename from rust/x509/src/x509_example_rust/src/all_architectures.rs rename to rust/x509/backend/src/all_architectures.rs diff --git a/rust/x509/src/x509_example_rust/src/lib.rs b/rust/x509/backend/src/lib.rs similarity index 100% rename from rust/x509/src/x509_example_rust/src/lib.rs rename to rust/x509/backend/src/lib.rs diff --git a/rust/x509/src/x509_example_rust/src/wasm_only.rs b/rust/x509/backend/src/wasm_only.rs similarity index 96% rename from rust/x509/src/x509_example_rust/src/wasm_only.rs rename to rust/x509/backend/src/wasm_only.rs index 4b97ffdf87..7df17315f0 100644 --- a/rust/x509/src/x509_example_rust/src/wasm_only.rs +++ b/rust/x509/backend/src/wasm_only.rs @@ -3,9 +3,11 @@ use crate::{CaKeyInformation, KeyName, PemCertificateRequest, X509CertificateStr use super::SchnorrAlgorithm; use candid::{CandidType, Principal}; use der::{asn1::BitString, pem::LineEnding, DecodePem, Encode, EncodePem}; -use ic_cdk::api::management_canister::ecdsa as cdk_ecdsa; use ic_cdk::export_candid; use ic_cdk::{api::time, init, update}; +use ic_cdk_management_canister::{ + self as management_canister, EcdsaCurve, EcdsaKeyId, EcdsaPublicKeyArgs, SignWithEcdsaArgs, +}; use pkcs8::AssociatedOid; use serde::{Deserialize, Serialize}; use signature::Keypair; @@ -44,13 +46,13 @@ impl TryFrom<&CaKeyInformation> for SchnorrKeyId { } } -impl TryFrom<&CaKeyInformation> for cdk_ecdsa::EcdsaKeyId { +impl TryFrom<&CaKeyInformation> for EcdsaKeyId { type Error = String; fn try_from(value: &CaKeyInformation) -> Result { match value { - CaKeyInformation::EcdsaSecp256k1(key_name) => Ok(cdk_ecdsa::EcdsaKeyId { - curve: cdk_ecdsa::EcdsaCurve::Secp256k1, + CaKeyInformation::EcdsaSecp256k1(key_name) => Ok(EcdsaKeyId { + curve: EcdsaCurve::Secp256k1, name: String::from(<&'static str>::from(key_name)), }), something_else => Err(format!( @@ -308,20 +310,20 @@ async fn root_ca_public_key_bytes() -> Result, String> { res.public_key } CaKeyInformation::EcdsaSecp256k1(_) => { - let args = cdk_ecdsa::EcdsaPublicKeyArgument { + let args = EcdsaPublicKeyArgs { canister_id: None, derivation_path: derivation_path(), key_id: CA_KEY_INFORMATION - .with(|value| cdk_ecdsa::EcdsaKeyId::try_from(value.borrow().deref()))?, + .with(|value| EcdsaKeyId::try_from(value.borrow().deref()))?, }; - let response = cdk_ecdsa::ecdsa_public_key(args) + let response = management_canister::ecdsa_public_key(&args) .await - .map_err(|e| format!("ecdsa_public_key failed {}", e.1))?; - response.0.public_key + .map_err(|e| format!("ecdsa_public_key failed {e:?}"))?; + response.public_key } }; - // try to initialize the cache with the fetched public key or returne the + // try to initialize the cache with the fetched public key or return the // cached value, because we were making an async call between the cache // check and cache initialization Ok(ROOT_CA_PUBLIC_KEY.with(move |inner| inner.get_or_init(|| result).clone())) diff --git a/rust/x509/src/x509_example_rust/src/wasm_only/signer.rs b/rust/x509/backend/src/wasm_only/signer.rs similarity index 90% rename from rust/x509/src/x509_example_rust/src/wasm_only/signer.rs rename to rust/x509/backend/src/wasm_only/signer.rs index a14f229254..de5a3da9a9 100644 --- a/rust/x509/src/x509_example_rust/src/wasm_only/signer.rs +++ b/rust/x509/backend/src/wasm_only/signer.rs @@ -2,7 +2,9 @@ use std::{convert::TryFrom, ops::Deref}; use candid::Principal; use elliptic_curve::sec1::ToEncodedPoint; -use ic_cdk::api::management_canister::ecdsa as cdk_ecdsa; +use ic_cdk_management_canister::{ + self as management_canister, EcdsaKeyId, SignWithEcdsaArgs, +}; use sha2::Digest; use spki::{AlgorithmIdentifierOwned, DynSignatureAlgorithmIdentifier}; @@ -75,7 +77,7 @@ impl DynSignatureAlgorithmIdentifier for Ed25519Signer { } pub struct EcdsaSecp256k1Signer { - key_id: cdk_ecdsa::EcdsaKeyId, + key_id: EcdsaKeyId, public_key: k256::ecdsa::VerifyingKey, } @@ -89,7 +91,7 @@ impl EcdsaSecp256k1Signer { .unwrap(); Ok(Self { key_id: CA_KEY_INFORMATION - .with(|value| cdk_ecdsa::EcdsaKeyId::try_from(value.borrow().deref()))?, + .with(|value| EcdsaKeyId::try_from(value.borrow().deref()))?, public_key, }) } @@ -100,16 +102,15 @@ impl Sign for EcdsaSecp256k1Signer { let mut hasher = sha2::Sha256::new(); hasher.update(msg); - let args = cdk_ecdsa::SignWithEcdsaArgument { + let args = SignWithEcdsaArgs { message_hash: hasher.finalize().to_vec(), derivation_path: derivation_path(), key_id: self.key_id.clone(), }; - let (internal_reply,): (cdk_ecdsa::SignWithEcdsaResponse,) = - cdk_ecdsa::sign_with_ecdsa(args) - .await - .map_err(|e| format!("sign_with_schnorr failed {e:?}"))?; + let internal_reply = management_canister::sign_with_ecdsa(&args) + .await + .map_err(|e| format!("sign_with_ecdsa failed {e:?}"))?; Ok( k256::ecdsa::Signature::from_slice(internal_reply.signature.as_slice()) diff --git a/rust/x509/dfx.json b/rust/x509/dfx.json deleted file mode 100644 index 01a4d5a0fd..0000000000 --- a/rust/x509/dfx.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "canisters": { - "x509_example_rust": { - "candid": "src/x509_example_rust/x509_example.did", - "package": "x509_example_rust", - "type": "rust", - "init_arg": "(variant { Ed25519 = variant { TestKey1 } })", - "metadata": [ - { - "name": "candid:service" - } - ] - } - } -} diff --git a/rust/x509/icp.yaml b/rust/x509/icp.yaml new file mode 100644 index 0000000000..ea796e0460 --- /dev/null +++ b/rust/x509/icp.yaml @@ -0,0 +1,7 @@ +networks: + - name: local + mode: managed +canisters: + - name: backend + recipe: + type: "@dfinity/rust@v3.3.0" diff --git a/rust/x509/src/x509_example_rust/tests/tests.rs b/rust/x509/src/x509_example_rust/tests/tests.rs deleted file mode 100644 index fa8eb91c99..0000000000 --- a/rust/x509/src/x509_example_rust/tests/tests.rs +++ /dev/null @@ -1,275 +0,0 @@ -use candid::{decode_one, encode_one, Principal}; -use openssl::{ - ec::{EcGroup, EcKey}, - hash::MessageDigest, - nid::Nid, - pkey::{PKey, PKeyRef, Private}, - x509::{X509Name, X509Req, X509}, -}; -use pocket_ic::{PocketIc, PocketIcBuilder, WasmResult}; -use std::convert::TryFrom; -use x509_example_rust::{CaKeyInformation, KeyName, PemCertificateRequest, X509CertificateString}; - -const WASM_PATH: &str = "../../target/wasm32-unknown-unknown/release/x509_example_rust.wasm"; - -mod smoke { - use super::*; - - #[test] - fn should_instantiate_pic() { - let _pic = PocketIcBuilder::new() - .with_application_subnet() - .with_ii_subnet() - .with_fiduciary_subnet() - .build(); - } - - #[test] - fn should_instantiate_pic_and_canister_id() { - let (_pic, _canister_id) = - pic_and_canister_id(CaKeyInformation::Ed25519(KeyName::TestKey1)); - } - - #[test] - fn should_fetch_root_ca_certificate() { - let (pic, canister_id) = pic_and_canister_id(CaKeyInformation::Ed25519(KeyName::TestKey1)); - let _root_certificate = fetch_root_ca_certificate(&pic, canister_id); - } -} - -mod ed25519 { - use super::*; - - #[test] - fn root_ca_certificate_should_be_valid() { - let (pic, canister_id) = pic_and_canister_id(CaKeyInformation::Ed25519(KeyName::TestKey1)); - - let root_certificate = fetch_root_ca_certificate(&pic, canister_id); - - assert!( - root_certificate - .verify( - &root_certificate - .public_key() - .expect("failed to get public key") - ) - .expect("errors occurred while verifying root certificate"), - "failed to verify root certificate" - ); - } - - #[test] - fn child_certificate_should_be_valid() { - let (pic, canister_id) = pic_and_canister_id(CaKeyInformation::Ed25519(KeyName::TestKey1)); - - let root_certificate = fetch_root_ca_certificate(&pic, canister_id); - - for (key, digest_type) in generate_child_keys() { - println!("Requesting child certificate with key: {key:?}"); - - let req = generate_child_certificate_request(&key, digest_type); - req.verify(&key) - .expect("failed to verify child certificate request"); - let pem_req = req - .to_pem() - .expect("failed to convert child certificate request to PEM"); - - let child_certificate = generate_child_certificate(pem_req, &pic, canister_id); - - assert!( - child_certificate - .verify( - &root_certificate - .public_key() - .expect("failed to get public key") - ) - .expect("errors occurred while verifying child certificate"), - "failed to verify child certificate" - ); - } - } -} - -mod ecdsa_secp256k1 { - use super::*; - - #[test] - fn root_ca_certificate_should_be_valid() { - let (pic, canister_id) = - pic_and_canister_id(CaKeyInformation::EcdsaSecp256k1(KeyName::TestKey1)); - - let root_certificate = fetch_root_ca_certificate(&pic, canister_id); - - assert!( - root_certificate - .verify( - &root_certificate - .public_key() - .expect("failed to get public key") - ) - .expect("errors occurred while verifying root certificate"), - "failed to verify root certificate" - ); - } - - #[test] - fn child_certificate_should_be_valid() { - let (pic, canister_id) = - pic_and_canister_id(CaKeyInformation::EcdsaSecp256k1(KeyName::TestKey1)); - - let root_certificate = fetch_root_ca_certificate(&pic, canister_id); - - for (key, digest_type) in generate_child_keys() { - println!("Requesting child certificate with key: {key:?}"); - - let req = generate_child_certificate_request(&key, digest_type); - req.verify(&key) - .expect("failed to verify child certificate request"); - let pem_req = req - .to_pem() - .expect("failed to convert child certificate request to PEM"); - - let child_certificate = generate_child_certificate(pem_req, &pic, canister_id); - - assert!( - child_certificate - .verify( - &root_certificate - .public_key() - .expect("failed to get public key") - ) - .expect("errors occurred while verifying child certificate"), - "failed to verify child certificate" - ); - } - } -} - -fn pic_and_canister_id(ca_key_information: CaKeyInformation) -> (PocketIc, Principal) { - let pic = PocketIcBuilder::new() - .with_application_subnet() - .with_ii_subnet() - .with_fiduciary_subnet() - .build(); - - let canister_id = pic.create_canister(); - pic.add_cycles(canister_id, 2_000_000_000_000); - - let wasm = std::fs::read(WASM_PATH).expect("Wasm file not found, run 'dfx build'."); - - pic.install_canister( - canister_id, - wasm, - encode_one(ca_key_information).unwrap(), - None, - ); - - (pic, canister_id) -} - -fn fetch_root_ca_certificate(pic: &PocketIc, canister_id: Principal) -> X509 { - let root_certificate_result: Result = match pic - .update_call( - canister_id, - Principal::anonymous(), - "root_ca_certificate", - encode_one(()).unwrap(), - ) - .expect("Failed to call counter canister") - { - WasmResult::Reply(r) => decode_one(&r).expect("failed to decode reply"), - WasmResult::Reject(r) => panic!("Call failed: {:?}", r), - }; - - let root_certificate_pem = root_certificate_result.expect("failed to compute root certificate"); - - X509::from_pem(root_certificate_pem.x509_certificate_string.as_bytes()) - .expect("failed to decode root certificate") -} - -fn generate_child_certificate(pem_req: Vec, pic: &PocketIc, canister_id: Principal) -> X509 { - let pem_certificate_request = String::from_utf8(pem_req).expect("invalid request encoding"); - let child_certificate_result: Result = match pic - .update_call( - canister_id, - Principal::anonymous(), - "child_certificate", - encode_one(PemCertificateRequest { - pem_certificate_request, - }) - .unwrap(), - ) - .expect("Failed to call counter canister") - { - WasmResult::Reply(r) => decode_one(&r).expect("failed to decode reply"), - WasmResult::Reject(r) => panic!("Call failed: {:?}", r), - }; - - let child_certificate_text = - child_certificate_result.expect("failed to compute child certificate"); - - X509::from_pem(child_certificate_text.x509_certificate_string.as_bytes()) - .expect("failed to decode child certificate") -} - -fn generate_child_certificate_request( - key: &PKeyRef, - digest_type: MessageDigest, -) -> X509Req { - let mut builder = X509Name::builder().expect("failed to create X509NameBuilder"); - builder - .append_entry_by_text("CN", "Test Corporation") - .expect("failed to append entry"); - builder - .append_entry_by_text("O", "Test Inc") - .expect("failed to append entry"); - builder - .append_entry_by_text("C", "US") - .expect("failed to append entry"); - let subject_name = builder.build(); - - let mut req_builder = X509Req::builder().expect("failed to create X509Req builder"); - - req_builder - .set_version(0) - .expect("failed to set version in child certificate"); - - req_builder - .set_subject_name(&subject_name) - .expect("failed to set subject name in child certificate"); - req_builder - .set_pubkey(&key) - .expect("failed to set public key in child certificate"); - req_builder - .sign(&key, digest_type) - .expect("failed to sign X509Req"); - - req_builder.build() -} - -fn generate_child_keys() -> Vec<(PKey, MessageDigest)> { - let ed25519_key = PKey::generate_ed25519().expect("failed to generate key"); - - let ec_group = EcGroup::from_curve_name(Nid::SECP256K1).expect("failed to create EC group"); - let ecdsa_key = - PKey::from_ec_key(EcKey::generate(&ec_group).expect("failed to generate ECDSA key")) - .unwrap(); - - vec![ - (ed25519_key, MessageDigest::null()), - (ecdsa_key, MessageDigest::sha256()), - ] -} - -#[test] -fn test_strum_produces_expected_key_names() { - assert_eq!( - <&'static str>::try_from(KeyName::DfxTestKey), - Ok("dfx_test_key") - ); - assert_eq!( - <&'static str>::try_from(KeyName::TestKey1), - Ok("test_key_1") - ); - assert_eq!(<&'static str>::try_from(KeyName::Key1), Ok("key_1")); -} diff --git a/rust/x509/src/x509_example_rust/x509_example.did b/rust/x509/src/x509_example_rust/x509_example.did deleted file mode 100644 index 6a7f782f00..0000000000 --- a/rust/x509/src/x509_example_rust/x509_example.did +++ /dev/null @@ -1,11 +0,0 @@ -type CaKeyInformation = variant { Ed25519 : KeyName; EcdsaSecp256k1 : KeyName }; -type PemCertificateRequest = record { pem_certificate_request : text }; -type PublicKeyReply = record { public_key_hex : text }; -type Result = variant { Ok : X509CertificateString; Err : text }; -type KeyName = variant { TestKey1; Key1; DfxTestKey }; -type X509CertificateString = record { x509_certificate_string : text }; - -service : (CaKeyInformation) -> { - child_certificate : (PemCertificateRequest) -> (Result); - root_ca_certificate : () -> (Result); -} \ No newline at end of file