simple-c2pa

This is a fork of https://gitlab.com/guardianproject/proofmode/simple-c2pa
git clone git://archive.git.mtrnord.blog/mtrnords-photography-manager/simple-c2pa.git
Log | Files | Refs | README | LICENSE

commit 791e5792e15c70dc02f472894ab068b5a89baae8
parent 2f484687b4e7f1e790ba59ac299caa308e7d9532
Author: Darren Clarke <darren@redaranj.com>
Date:   Mon,  4 Dec 2023 17:56:58 +0000

Merge branch 'develop' into 'main'

Refactoring

See merge request guardianproject/proofmode/simple-c2pa!1
Diffstat:
A.gitlab-ci.android.yml | 41+++++++++++++++++++++++++++++++++++++++++
A.gitlab-ci.apple.yml | 41+++++++++++++++++++++++++++++++++++++++++
M.gitlab-ci.yml | 4++--
MCargo.lock | 853+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------
MCargo.toml | 19++++++++++++++++---
DMakefile | 7-------
AMakefile.toml | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dmobile/Cargo.lock | 2817-------------------------------------------------------------------------------
Dmobile/Cargo.toml | 24------------------------
Dmobile/android/.gitlab-ci.yml | 41-----------------------------------------
Dmobile/android/build.sh | 40----------------------------------------
Dmobile/apple/.gitlab-ci.yml | 41-----------------------------------------
Dmobile/apple/build.sh | 45---------------------------------------------
Dmobile/build.rs | 18------------------
Dmobile/src/lib.rs | 89-------------------------------------------------------------------------------
Dmobile/src/simple-c2pa-mobile.udl | 5-----
Asrc/assertions.rs | 311+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Asrc/bin/uniffi-bindgen.rs | 5+++++
Msrc/certificates.rs | 236++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
Asrc/common.rs | 104+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Msrc/content_credentials.rs | 342++++++++++++++++++++++++++++---------------------------------------------------
Msrc/lib.rs | 15++++++++++++---
Atests/main.rs | 87+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Auniffi.toml | 5+++++
24 files changed, 1653 insertions(+), 3638 deletions(-)

diff --git a/.gitlab-ci.android.yml b/.gitlab-ci.android.yml @@ -0,0 +1,41 @@ +stages: + - build + - upload + - release + +build_android: + tags: + - proofmode-macos + stage: build + script: + - cargo make android-build + artifacts: + paths: + - ./out/android/ + +upload_android: + stage: upload + image: curlimages/curl:latest + script: + - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./out/android/kotlin.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa/android-v0.${CI_PIPELINE_IID}/kotlin.zip"' + - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./out/android/jniLibs.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa/android-v0.${CI_PIPELINE_IID}/jniLibs.zip"' + +release_android: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + rules: + - if: $CI_COMMIT_TAG + when: never + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + script: + - echo "running release_android for $TAG" + release: + tag_name: "android-v0.$CI_PIPELINE_IID" + description: "android-v0.$CI_PIPELINE_IID" + ref: "$CI_COMMIT_SHA" + assets: + links: + - name: "kotlin.zip" + url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa/android-v0.${CI_PIPELINE_IID}/kotlin.zip" + - name: "jniLibs.zip" + url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa/android-v0.${CI_PIPELINE_IID}/jniLibs.zip" diff --git a/.gitlab-ci.apple.yml b/.gitlab-ci.apple.yml @@ -0,0 +1,41 @@ +stages: + - build + - upload + - release + +build_apple: + tags: + - proofmode-macos + stage: build + script: + - cargo make apple-build + artifacts: + paths: + - ./out/apple/ + +upload_apple: + stage: upload + image: curlimages/curl:latest + script: + - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./out/apple/SimpleC2PA.swift "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa/apple-v0.${CI_PIPELINE_IID}/SimpleC2PA.swift"' + - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./out/apple/SimpleC2PA.xcframework.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa/apple-v0.${CI_PIPELINE_IID}/SimpleC2PA.xcframework.zip"' + +release_apple: + stage: release + image: registry.gitlab.com/gitlab-org/release-cli:latest + rules: + - if: $CI_COMMIT_TAG + when: never + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + script: + - echo "running release_apple for $TAG" + release: + tag_name: "apple-v0.$CI_PIPELINE_IID" + description: "apple-v0.$CI_PIPELINE_IID" + ref: "$CI_COMMIT_SHA" + assets: + links: + - name: "SimpleC2PA.swift" + url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa/apple-v0.${CI_PIPELINE_IID}/SimpleC2PA.swift" + - name: "SimpleC2PA.xcframework.zip" + url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa/apple-v0.${CI_PIPELINE_IID}/SimpleC2PA.xcframework.zip" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml @@ -4,9 +4,9 @@ stages: trigger_apple: stage: triggers trigger: - include: "mobile/apple/.gitlab-ci.yml" + include: ".gitlab-ci.apple.yml" trigger_android: stage: triggers trigger: - include: "mobile/android/.gitlab-ci.yml" + include: ".gitlab-ci.android.yml" diff --git a/Cargo.lock b/Cargo.lock @@ -9,6 +9,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + +[[package]] name = "android-tzdata" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -24,6 +33,54 @@ dependencies = [ ] [[package]] +name = "anstream" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +dependencies = [ + "anstyle", + "windows-sys", +] + +[[package]] name = "anyhow" version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -42,10 +99,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] -name = "arrayvec" -version = "0.7.4" +name = "askama" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +dependencies = [ + "askama_derive", + "askama_escape", +] + +[[package]] +name = "askama_derive" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a0fc7dcf8bd4ead96b1d36b41df47c14beedf7b0301fc543d8f2384e66a2ec0" +dependencies = [ + "askama_parser", + "basic-toml", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "serde", + "syn 2.0.39", +] + +[[package]] +name = "askama_escape" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + +[[package]] +name = "askama_parser" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c268a96e01a4c47c8c5c2472aaa570707e006a875ea63e819f75474ceedaf7b4" +dependencies = [ + "nom", +] [[package]] name = "asn1-rs" @@ -145,6 +237,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] +name = "basic-toml" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" +dependencies = [ + "serde", +] + +[[package]] name = "bcder" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -155,10 +256,13 @@ dependencies = [ ] [[package]] -name = "bit_field" -version = "0.10.2" +name = "bincode" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] [[package]] name = "bitflags" @@ -179,8 +283,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" dependencies = [ "arrayref", - "arrayvec 0.5.2", - "constant_time_eq 0.1.5", + "arrayvec", + "constant_time_eq", ] [[package]] @@ -190,21 +294,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" dependencies = [ "arrayref", - "arrayvec 0.5.2", - "constant_time_eq 0.1.5", -] - -[[package]] -name = "blake3" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" -dependencies = [ - "arrayref", - "arrayvec 0.7.4", - "cc", - "cfg-if", - "constant_time_eq 0.3.0", + "arrayvec", + "constant_time_eq", ] [[package]] @@ -267,9 +358,9 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "c2pa" -version = "0.28.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2ce5b3244534018144a9f476591af81232986c041df81d5f01daa27b728ace" +checksum = "cf260678ddf02ac49b8375a1b22192cc375a05ce9ce700f473acc86945f113e7" dependencies = [ "asn1-rs", "async-generic", @@ -277,7 +368,6 @@ dependencies = [ "atree", "base64 0.21.5", "bcder", - "blake3", "byteorder", "byteordered", "bytes", @@ -289,7 +379,6 @@ dependencies = [ "extfmt", "fast-xml", "getrandom", - "half 2.2.1", "hex", "id3", "image", @@ -334,6 +423,38 @@ dependencies = [ ] [[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + +[[package]] name = "cc" version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -387,16 +508,62 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" dependencies = [ "ciborium-io", - "half 1.8.2", + "half", +] + +[[package]] +name = "clap" +version = "4.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", ] [[package]] +name = "clap_derive" +version = "4.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[package]] +name = "clap_lex" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + +[[package]] name = "color_quant" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" [[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + +[[package]] name = "console_log" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -426,12 +593,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" [[package]] -name = "constant_time_eq" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] name = "conv" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -475,45 +636,6 @@ dependencies = [ ] [[package]] -name = "crossbeam-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] name = "crypto-bigint" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -649,12 +771,6 @@ dependencies = [ ] [[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] name = "errno" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -665,22 +781,6 @@ dependencies = [ ] [[package]] -name = "exr" -version = "1.71.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8" -dependencies = [ - "bit_field", - "flume", - "half 2.2.1", - "lebe", - "miniz_oxide 0.7.1", - "rayon-core", - "smallvec", - "zune-inflate", -] - -[[package]] name = "extfmt" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -721,15 +821,6 @@ dependencies = [ ] [[package]] -name = "flume" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" -dependencies = [ - "spin 0.9.8", -] - -[[package]] name = "foreign-types" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -754,6 +845,28 @@ dependencies = [ ] [[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + +[[package]] +name = "generator" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" +dependencies = [ + "cc", + "libc", + "log", + "rustversion", + "windows", +] + +[[package]] name = "generic-array" version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -777,13 +890,20 @@ dependencies = [ ] [[package]] -name = "gif" -version = "0.12.0" +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "goblin" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" dependencies = [ - "color_quant", - "weezl", + "log", + "plain", + "scroll", ] [[package]] @@ -793,13 +913,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] -name = "half" -version = "2.2.1" +name = "heck" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" -dependencies = [ - "crunchy", -] +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hex" @@ -860,14 +977,10 @@ dependencies = [ "bytemuck", "byteorder", "color_quant", - "exr", - "gif", "jpeg-decoder", "num-rational", "num-traits", "png", - "qoi", - "tiff", ] [[package]] @@ -913,9 +1026,6 @@ name = "jpeg-decoder" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" -dependencies = [ - "rayon", -] [[package]] name = "js-sys" @@ -951,12 +1061,6 @@ dependencies = [ ] [[package]] -name = "lebe" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" - -[[package]] name = "libc" version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -975,20 +1079,33 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] -name = "lock_api" -version = "0.4.11" +name = "log" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "loom" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ - "autocfg", - "scopeguard", + "cfg-if", + "generator", + "pin-utils", + "scoped-tls", + "tracing", + "tracing-subscriber", ] [[package]] -name = "log" -version = "0.4.20" +name = "matchers" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] [[package]] name = "memchr" @@ -997,12 +1114,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] -name = "memoffset" -version = "0.9.0" +name = "mime" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" dependencies = [ - "autocfg", + "mime", + "unicase", ] [[package]] @@ -1091,6 +1215,16 @@ dependencies = [ ] [[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] name = "num-bigint" version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1178,6 +1312,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] +name = "oneshot" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f6640c6bda7731b1fdbab747981a0f896dd1fedaf9f4a53fa237a04a84431f4" +dependencies = [ + "loom", +] + +[[package]] name = "opaque-debug" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1232,6 +1375,18 @@ dependencies = [ ] [[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] name = "pem" version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1256,6 +1411,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] name = "pix" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1290,6 +1457,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] name = "png" version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1334,15 +1507,6 @@ dependencies = [ ] [[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - -[[package]] name = "quote" version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1392,35 +1556,59 @@ dependencies = [ ] [[package]] -name = "rayon" -version = "1.8.0" +name = "redox_syscall" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ - "either", - "rayon-core", + "bitflags 1.3.2", ] [[package]] -name = "rayon-core" -version = "1.12.0" +name = "regex" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ - "crossbeam-deque", - "crossbeam-utils", + "aho-corasick", + "memchr", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] -name = "redox_syscall" -version = "0.4.1" +name = "regex-automata" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "bitflags 1.3.2", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", ] [[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.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] name = "riff" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1520,16 +1708,42 @@ dependencies = [ ] [[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] name = "ryu" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] -name = "scopeguard" -version = "1.2.0" +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scroll" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] [[package]] name = "sct" @@ -1542,6 +1756,15 @@ dependencies = [ ] [[package]] +name = "semver" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +dependencies = [ + "serde", +] + +[[package]] name = "serde" version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1585,7 +1808,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" dependencies = [ - "half 1.8.2", + "half", "serde", ] @@ -1661,6 +1884,15 @@ dependencies = [ ] [[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 = "signature" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1674,9 +1906,8 @@ checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" [[package]] name = "simple-c2pa" -version = "0.6.0" +version = "0.8.0" dependencies = [ - "anyhow", "c2pa", "log", "openssl", @@ -1684,9 +1915,17 @@ dependencies = [ "serde", "serde_json", "tempfile", + "thiserror", + "uniffi", ] [[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] name = "smallvec" version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1703,9 +1942,6 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] [[package]] name = "spki" @@ -1737,6 +1973,18 @@ dependencies = [ ] [[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] name = "subtle" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1810,14 +2058,13 @@ dependencies = [ ] [[package]] -name = "tiff" -version = "0.9.0" +name = "thread_local" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "flate2", - "jpeg-decoder", - "weezl", + "cfg-if", + "once_cell", ] [[package]] @@ -1865,6 +2112,76 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[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-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + +[[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-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", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] name = "treeline" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1893,6 +2210,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" [[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + +[[package]] name = "unicode-bidi" version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1920,6 +2246,138 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] +name = "uniffi" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e192430644d99babe02bede25316eee84fa154b1e5f8cfe99406c028b8c577" +dependencies = [ + "anyhow", + "camino", + "clap", + "uniffi_bindgen", + "uniffi_build", + "uniffi_core", + "uniffi_macros", +] + +[[package]] +name = "uniffi_bindgen" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c235355da41bc8347b2d5851e1060d4652dfbdc6d7d6ccddaabebe25e3c32a4" +dependencies = [ + "anyhow", + "askama", + "camino", + "cargo_metadata", + "clap", + "fs-err", + "glob", + "goblin", + "heck", + "once_cell", + "paste", + "serde", + "toml", + "uniffi_meta", + "uniffi_testing", + "uniffi_udl", +] + +[[package]] +name = "uniffi_build" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81049ed7015a8a66b085aca3fb0c0011fdae4dd9ab8c38f5751f7861d60eb0f4" +dependencies = [ + "anyhow", + "camino", + "uniffi_bindgen", +] + +[[package]] +name = "uniffi_checksum_derive" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce082833f0fcaf6fc221fbab26720440daf99381f5a71e89b6e23375eb6ea770" +dependencies = [ + "quote", + "syn 2.0.39", +] + +[[package]] +name = "uniffi_core" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389bbe4d8334b3370c7cc998788d7a9619e0b61b58f1cbcd4a6a8606ab0a6f7d" +dependencies = [ + "anyhow", + "bytes", + "camino", + "log", + "once_cell", + "oneshot", + "paste", + "static_assertions", +] + +[[package]] +name = "uniffi_macros" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34aa170f970d42d8fbe205f5794b83f72d6617835a73b91ed1869e1eba5dd06c" +dependencies = [ + "bincode", + "camino", + "fs-err", + "once_cell", + "proc-macro2", + "quote", + "serde", + "syn 2.0.39", + "toml", + "uniffi_build", + "uniffi_meta", +] + +[[package]] +name = "uniffi_meta" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ef337c28a379ed6962eae0cb0824ab31202b21b8ae3bf6c2a706f5e7285f5f" +dependencies = [ + "anyhow", + "bytes", + "siphasher", + "uniffi_checksum_derive", +] + +[[package]] +name = "uniffi_testing" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f2e218997229b4ed6e08c1abc9e277dde817f68a633babd3ebbfc77e32db302" +dependencies = [ + "anyhow", + "camino", + "cargo_metadata", + "fs-err", + "once_cell", +] + +[[package]] +name = "uniffi_udl" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb29909e50256f32986ea3b3c32d2c49dece14ae4b3428c047913696ed200b2a" +dependencies = [ + "anyhow", + "uniffi_meta", + "uniffi_testing", + "weedle2", +] + +[[package]] name = "unsigned-varint" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1965,6 +2423,12 @@ dependencies = [ ] [[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] name = "uuid" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1976,6 +2440,12 @@ dependencies = [ ] [[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] name = "vcpkg" version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2076,10 +2546,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" [[package]] -name = "weezl" -version = "0.1.7" +name = "weedle2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" +checksum = "2e79c5206e1f43a2306fd64bdb95025ee4228960f2e6c5a8b173f3caaf807741" +dependencies = [ + "nom", +] [[package]] name = "winapi" @@ -2104,6 +2577,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + +[[package]] name = "windows-core" version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -2218,12 +2700,3 @@ name = "zeroize" version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" - -[[package]] -name = "zune-inflate" -version = "0.2.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" -dependencies = [ - "simd-adler32", -] diff --git a/Cargo.toml b/Cargo.toml @@ -1,17 +1,30 @@ [package] name = "simple-c2pa" -version = "0.6.0" +version = "0.8.0" edition = "2021" [dependencies] -anyhow = "1.0.75" -c2pa = { version = "0.28.0", features = ["file_io", "add_thumbnails"] } +c2pa = { version = "0.28.3", features = ["file_io", "add_thumbnails"] } log = "0.4.20" openssl = "0.10.48" ring = "0.17.5" serde = "1.0.192" serde_json = "1.0.108" tempfile = "3.8.1" +thiserror = "1.0.50" +uniffi = { version = "0.25.2", features = ["build", "cli"] } + +# [profile.release] +# strip = true +# opt-level = "z" +# lto = true +# codegen-units = 1 +# panic = "abort" [lib] name = "simple_c2pa" +crate-type = ["lib", "staticlib", "cdylib"] + +[[bin]] +name = "uniffi-bindgen" +path = "src/bin/uniffi-bindgen.rs" diff --git a/Makefile b/Makefile @@ -1,7 +0,0 @@ -.PHONY: apple android - -apple: - ./mobile/apple/build.sh; - -android: - ./mobile/android/build.sh; diff --git a/Makefile.toml b/Makefile.toml @@ -0,0 +1,101 @@ +[env] +BUILD_MODE = "release" +TARGET_DIR = "target" +BINDINGS_DIR = "bindings" +OUT_DIR = "out" + +[tasks.clean-build-dirs] +script = ''' +rm -rf "${TARGET_DIR}" +rm -rf "${BINDINGS_DIR}" +rm -rf "${OUT_DIR}" +''' + +[tasks.common-install-dependencies] +script = 'cargo install --force cargo-make' + +[tasks.apple-install-dependencies] +script = 'rustup target add aarch64-apple-ios x86_64-apple-ios aarch64-apple-ios-sim' + +[tasks.apple-build-bindings] +script = 'cargo run --bin uniffi-bindgen generate --language swift --library ${TARGET_DIR}/aarch64-apple-ios/release/libsimple_c2pa.a --out-dir ${BINDINGS_DIR}/swift' + +[tasks.apple-build-libraries] +script = ''' +cargo build --target aarch64-apple-darwin --release +cargo build --target aarch64-apple-ios --release +cargo build --target x86_64-apple-ios --release +cargo build --target aarch64-apple-ios-sim --release +''' +dependencies = ["common-install-dependencies"] + +[tasks.apple-assemble-framework] +env = { NAME = "SimpleC2PA", LIB_NAME = "simple_c2pa", HEADER_PATH = "${BINDINGS_DIR}/swift/${NAME}FFI.h", NEW_HEADER_DIR = "${BINDINGS_DIR}/swift/include", STATIC_LIB_NAME = "lib${LIB_NAME}.a", OUT_DIR = "out/apple" } +script = ''' +mkdir -p "${NEW_HEADER_DIR}" +cp "${HEADER_PATH}" "${NEW_HEADER_DIR}/" +cp "${BINDINGS_DIR}/swift/${NAME}FFI.modulemap" "${NEW_HEADER_DIR}/module.modulemap" + +rm -rf "${OUT_DIR}" +mkdir -p ${OUT_DIR} + +xcrun lipo -create -output "${TARGET_DIR}/simulators.a" "${TARGET_DIR}/aarch64-apple-ios-sim/${BUILD_MODE}/${STATIC_LIB_NAME}" "${TARGET_DIR}/x86_64-apple-ios/${BUILD_MODE}/${STATIC_LIB_NAME}" + +xcodebuild -create-xcframework \ + -library "${TARGET_DIR}/aarch64-apple-ios/${BUILD_MODE}/${STATIC_LIB_NAME}" \ + -headers "${NEW_HEADER_DIR}" \ + -library "${TARGET_DIR}/simulators.a" \ + -headers "${NEW_HEADER_DIR}" \ + -output "${OUT_DIR}/${NAME}.xcframework" + +(cd "${OUT_DIR}" && zip -r "${NAME}.xcframework.zip" "${NAME}.xcframework") +rm -rf "${OUT_DIR}/${NAME}.xcframework" +cp "${BINDINGS_DIR}/swift/${NAME}.swift" "${OUT_DIR}/" +''' + +[tasks.apple-build] +dependencies = [ + "apple-install-dependencies", + "apple-build-libraries", + "apple-build-bindings", + "apple-assemble-framework", +] + +[tasks.android-install-dependencies] +script = 'cargo install cross' +dependencies = ["common-install-dependencies"] + +[tasks.android-build-libraries] +script = ''' +cross build --target x86_64-linux-android --release +cross build --target i686-linux-android --release +cross build --target armv7-linux-androideabi --release +cross build --target aarch64-linux-android --release +''' + +[tasks.android-build-bindings] +script = 'cargo run --bin uniffi-bindgen generate --language kotlin --library ./target/armeabi-v7a/release/libsimple_c2pa.so --out-dir ${BINDINGS_DIR}/kotlin' + +[tasks.android-assemble-aar-files] +env = { NAME = "simple_c2pa", LIB_NAME = "lib${NAME}.so", OUT_DIR = "out/android", JNILIBS_DIR = "${OUT_DIR}/jniLibs", ANDROID_BINDINGS_DIR = "kotlin/info/guardianproject/simple_c2pa" } +script = ''' +rm -rf "${OUT_DIR}" +mkdir -p ${OUT_DIR}/${ANDROID_BINDINGS_DIR} +cp ${BINDINGS_DIR}/${ANDROID_BINDINGS_DIR}/* ${OUT_DIR}/${ANDROID_BINDINGS_DIR}/ +echo "${JNILIBS_DIR}/x86_64" +mkdir -p "${JNILIBS_DIR}/x86_64" "${JNILIBS_DIR}/x86" "${JNILIBS_DIR}/armeabi-v7a" "${JNILIBS_DIR}/arm64-v8a" +cp "${TARGET_DIR}/x86_64-linux-android/${BUILD_MODE}/${LIB_NAME}" "${JNILIBS_DIR}/x86_64/${LIB_NAME}" +cp "${TARGET_DIR}/i686-linux-android/${BUILD_MODE}/${LIB_NAME}" "${JNILIBS_DIR}/x86/${LIB_NAME}" +cp "${TARGET_DIR}/armv7-linux-androideabi/${BUILD_MODE}/${LIB_NAME}" "${JNILIBS_DIR}/armeabi-v7a/${LIB_NAME}" +cp "${TARGET_DIR}/aarch64-linux-android/${BUILD_MODE}/${LIB_NAME}" "${JNILIBS_DIR}/arm64-v8a/${LIB_NAME}" +(cd "${OUT_DIR}" && zip -r "jniLibs.zip" "jniLibs") +(cd "${OUT_DIR}" && zip -r "kotlin.zip" "kotlin") +''' + +[tasks.android-build] +dependencies = [ + "android-install-dependencies", + "android-build-libraries", + "android-build-bindings", + "android-assemble-aar-files", +] diff --git a/mobile/Cargo.lock b/mobile/Cargo.lock @@ -1,2817 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - -[[package]] -name = "anyhow" -version = "1.0.75" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" - -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" - -[[package]] -name = "askama" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" -dependencies = [ - "askama_derive", - "askama_escape", -] - -[[package]] -name = "askama_derive" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a0fc7dcf8bd4ead96b1d36b41df47c14beedf7b0301fc543d8f2384e66a2ec0" -dependencies = [ - "askama_parser", - "basic-toml", - "mime", - "mime_guess", - "proc-macro2", - "quote", - "serde", - "syn 2.0.39", -] - -[[package]] -name = "askama_escape" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" - -[[package]] -name = "askama_parser" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c268a96e01a4c47c8c5c2472aaa570707e006a875ea63e819f75474ceedaf7b4" -dependencies = [ - "nom", -] - -[[package]] -name = "asn1-rs" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6fd5ddaf0351dff5b8da21b2fb4ff8e08ddd02857f0bf69c47639106c0fff0" -dependencies = [ - "asn1-rs-derive", - "asn1-rs-impl", - "displaydoc", - "nom", - "num-traits", - "rusticata-macros", - "thiserror", - "time", -] - -[[package]] -name = "asn1-rs-derive" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "synstructure", -] - -[[package]] -name = "asn1-rs-impl" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "async-generic" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86bc01d15ca67ec7653924057aa97c30de62d06a24e6834387eba6c72c8318e7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "async-trait" -version = "0.1.74" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "atree" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "132573478eb9ff973c6f75d0ed425ac12da77d266506483345f46743ecc83a98" - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "base64" -version = "0.21.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "basic-toml" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" -dependencies = [ - "serde", -] - -[[package]] -name = "bcder" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf16bec990f8ea25cab661199904ef452fcf11f565c404ce6cffbdf3f8cbbc47" -dependencies = [ - "bytes", - "smallvec", -] - -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - -[[package]] -name = "bit_field" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" - -[[package]] -name = "blake2b_simd" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq 0.1.5", -] - -[[package]] -name = "blake2s_simd" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e461a7034e85b211a4acb57ee2e6730b32912b06c08cc242243c39fc21ae6a2" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "constant_time_eq 0.1.5", -] - -[[package]] -name = "blake3" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" -dependencies = [ - "arrayref", - "arrayvec 0.7.4", - "cc", - "cfg-if", - "constant_time_eq 0.3.0", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "block-padding", - "generic-array", -] - -[[package]] -name = "block-buffer" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" -dependencies = [ - "generic-array", -] - -[[package]] -name = "block-padding" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" - -[[package]] -name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytemuck" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "byteordered" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf2cd9424f5ff404aba1959c835cbc448ee8b689b870a9981c76c0fd46280e6" -dependencies = [ - "byteorder", -] - -[[package]] -name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "c2pa" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2ce5b3244534018144a9f476591af81232986c041df81d5f01daa27b728ace" -dependencies = [ - "asn1-rs", - "async-generic", - "async-trait", - "atree", - "base64 0.21.5", - "bcder", - "blake3", - "byteorder", - "byteordered", - "bytes", - "chrono", - "ciborium", - "console_log", - "conv", - "coset", - "extfmt", - "fast-xml", - "getrandom", - "half 2.2.1", - "hex", - "id3", - "image", - "img-parts", - "instant", - "jfifdump", - "js-sys", - "lazy_static", - "log", - "mp4", - "multibase", - "multihash", - "openssl", - "openssl-sys", - "png_pong", - "rand", - "range-set", - "riff", - "ring 0.16.20", - "rsa", - "serde", - "serde-transcode", - "serde-wasm-bindgen", - "serde_bytes", - "serde_cbor", - "serde_derive", - "serde_json", - "sha2 0.10.8", - "spki 0.6.0", - "tempfile", - "thiserror", - "treeline", - "twoway", - "ureq", - "url", - "uuid", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "x509-certificate", - "x509-parser", -] - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chrono" -version = "0.4.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" -dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", - "num-traits", - "serde", - "wasm-bindgen", - "windows-targets", -] - -[[package]] -name = "ciborium" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" - -[[package]] -name = "ciborium-ll" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" -dependencies = [ - "ciborium-io", - "half 1.8.2", -] - -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - -[[package]] -name = "console_log" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8aed40e4edbf4d3b4431ab260b63fdc40f5780a4766824329ea0f1eefe3c0f" -dependencies = [ - "log", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "const-oid" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" - -[[package]] -name = "const-oid" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "constant_time_eq" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" - -[[package]] -name = "conv" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" -dependencies = [ - "custom_derive", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - -[[package]] -name = "coset" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c214bbc5c8b4518856d79cae4d323feaa881ecf3e31b5af6572bb5313c11d5" -dependencies = [ - "ciborium", - "ciborium-io", -] - -[[package]] -name = "cpufeatures" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-bigint" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "custom_derive" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" - -[[package]] -name = "data-encoding" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" - -[[package]] -name = "data-encoding-macro" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c904b33cc60130e1aeea4956ab803d08a3f4a0ca82d64ed757afac3891f2bb99" -dependencies = [ - "data-encoding", - "data-encoding-macro-internal", -] - -[[package]] -name = "data-encoding-macro-internal" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fdf3fce3ce863539ec1d7fd1b6dcc3c645663376b43ed376bbf887733e4f772" -dependencies = [ - "data-encoding", - "syn 1.0.109", -] - -[[package]] -name = "der" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" -dependencies = [ - "const-oid 0.7.1", - "crypto-bigint", - "pem-rfc7468", -] - -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid 0.9.5", -] - -[[package]] -name = "der" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" -dependencies = [ - "const-oid 0.9.5", - "zeroize", -] - -[[package]] -name = "der-parser" -version = "8.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbd676fbbab537128ef0278adb5576cf363cff6aa22a7b24effe97347cfab61e" -dependencies = [ - "asn1-rs", - "displaydoc", - "nom", - "num-bigint", - "num-traits", - "rusticata-macros", -] - -[[package]] -name = "deranged" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" -dependencies = [ - "powerfmt", -] - -[[package]] -name = "digest" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" -dependencies = [ - "generic-array", -] - -[[package]] -name = "digest" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" -dependencies = [ - "block-buffer 0.10.4", - "crypto-common", -] - -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "errno" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "exr" -version = "1.71.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8" -dependencies = [ - "bit_field", - "flume", - "half 2.2.1", - "lebe", - "miniz_oxide 0.7.1", - "rayon-core", - "smallvec", - "zune-inflate", -] - -[[package]] -name = "extfmt" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a48fe53466ab1f4ea6303bf9d7a0ca8060778590f09fd6c3304cc817aeb9935d" - -[[package]] -name = "fast-xml" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7ffc2f9e1373cd82b4d4ce2f84f8162edd48e3932abeb19c06170b66dbbd6c" -dependencies = [ - "memchr", -] - -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "fdeflate" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" -dependencies = [ - "simd-adler32", -] - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide 0.7.1", -] - -[[package]] -name = "flume" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" -dependencies = [ - "spin 0.9.8", -] - -[[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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fs-err" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" - -[[package]] -name = "generator" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" -dependencies = [ - "cc", - "libc", - "log", - "rustversion", - "windows", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "gif" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" -dependencies = [ - "color_quant", - "weezl", -] - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "goblin" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" -dependencies = [ - "log", - "plain", - "scroll", -] - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "half" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" -dependencies = [ - "crunchy", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "iana-time-zone" -version = "0.1.58" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - -[[package]] -name = "id3" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9592fef083f91c77848100693b236275caf57ac48ed1fdfe44287cb727e0936" -dependencies = [ - "bitflags 2.4.1", - "byteorder", - "flate2", -] - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "image" -version = "0.24.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "exr", - "gif", - "jpeg-decoder", - "num-rational", - "num-traits", - "png", - "qoi", - "tiff", -] - -[[package]] -name = "img-parts" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19358258d99a5fc34466fed27a5318f92ae636c3e36165cf9b1e87b5b6701f0" -dependencies = [ - "bytes", - "crc32fast", - "miniz_oxide 0.5.4", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "itoa" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" - -[[package]] -name = "jfifdump" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b56eea9f2724de66d5f44cbc4b45e716a32c83a581d163cee2b767ddc220426" -dependencies = [ - "json", -] - -[[package]] -name = "jpeg-decoder" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" -dependencies = [ - "rayon", -] - -[[package]] -name = "js-sys" -version = "0.3.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "json" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" - -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin 0.5.2", -] - -[[package]] -name = "lebe" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" - -[[package]] -name = "libc" -version = "0.2.150" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" - -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "linux-raw-sys" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" - -[[package]] -name = "lock_api" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "loom" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" -dependencies = [ - "cfg-if", - "generator", - "pin-utils", - "scoped-tls", - "tracing", - "tracing-subscriber", -] - -[[package]] -name = "matchers" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" -dependencies = [ - "regex-automata 0.1.10", -] - -[[package]] -name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[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.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" -dependencies = [ - "adler", - "autocfg", -] - -[[package]] -name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", - "simd-adler32", -] - -[[package]] -name = "mp4" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509348cba250e7b852a875100a2ddce7a36ee3abf881a681c756670c1774264d" -dependencies = [ - "byteorder", - "bytes", - "num-rational", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "multibase" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3539ec3c1f04ac9748a260728e855f261b4977f5c3406612c884564f329404" -dependencies = [ - "base-x", - "data-encoding", - "data-encoding-macro", -] - -[[package]] -name = "multihash" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567122ab6492f49b59def14ecc36e13e64dca4188196dd0cd41f9f3f979f3df6" -dependencies = [ - "blake2b_simd", - "blake2s_simd", - "digest 0.9.0", - "sha-1", - "sha2 0.9.9", - "sha3", - "unsigned-varint", -] - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nu-ansi-term" -version = "0.46.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" -dependencies = [ - "overload", - "winapi", -] - -[[package]] -name = "num-bigint" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" -dependencies = [ - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", - "serde", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", - "libm", -] - -[[package]] -name = "oid-registry" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bedf36ffb6ba96c2eb7144ef6270557b52e54b20c0a8e1eb2ff99a6c6959bff" -dependencies = [ - "asn1-rs", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "oneshot" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f6640c6bda7731b1fdbab747981a0f896dd1fedaf9f4a53fa237a04a84431f4" -dependencies = [ - "loom", -] - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "openssl" -version = "0.10.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" -dependencies = [ - "bitflags 2.4.1", - "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.39", -] - -[[package]] -name = "openssl-src" -version = "111.28.0+1.1.1w" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ce95ee1f6f999dfb95b8afd43ebe442758ea2104d1ccb99a94c30db22ae701f" -dependencies = [ - "cc", -] - -[[package]] -name = "openssl-sys" -version = "0.9.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b" -dependencies = [ - "cc", - "libc", - "openssl-src", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "overload" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" - -[[package]] -name = "paste" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] - -[[package]] -name = "pem-rfc7468" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01de5d978f34aa4b2296576379fcc416034702fd94117c56ffd8a1a767cefb30" -dependencies = [ - "base64ct", -] - -[[package]] -name = "percent-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "pin-project-lite" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pix" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de5067af0cd27add969cdb4ef2eecc955f59235f3b7a75a3c6ac9562cfb6b81" - -[[package]] -name = "pkcs1" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78f66c04ccc83dd4486fd46c33896f4e17b24a7a3a6400dedc48ed0ddd72320" -dependencies = [ - "der 0.5.1", - "pkcs8", - "zeroize", -] - -[[package]] -name = "pkcs8" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" -dependencies = [ - "der 0.5.1", - "spki 0.5.4", - "zeroize", -] - -[[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - -[[package]] -name = "png" -version = "0.17.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" -dependencies = [ - "bitflags 1.3.2", - "crc32fast", - "fdeflate", - "flate2", - "miniz_oxide 0.7.1", -] - -[[package]] -name = "png_pong" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b76c1da19406fed18e81972b9015a775447532647b04a8949135916d67778f" -dependencies = [ - "miniz_oxide 0.4.4", - "pix", -] - -[[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.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "proc-macro2" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "qoi" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "quote" -version = "1.0.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" -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 = "range-set" -version = "0.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6558ccfefeefa880f80c0e957c3748cbcf75c937900eb0604d0f2acc6a84f8dc" -dependencies = [ - "num-traits", - "smallvec", -] - -[[package]] -name = "rayon" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "1.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", -] - -[[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.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.8.2", -] - -[[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.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" - -[[package]] -name = "riff" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b1a3d5f46d53f4a3478e2be4a5a5ce5108ea58b100dcd139830eae7f79a3a1" - -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - -[[package]] -name = "ring" -version = "0.17.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" -dependencies = [ - "cc", - "getrandom", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys", -] - -[[package]] -name = "rsa" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cf22754c49613d2b3b119f0e5d46e34a2c628a937e3024b8762de4e7d8c710b" -dependencies = [ - "byteorder", - "digest 0.10.7", - "num-bigint-dig", - "num-integer", - "num-iter", - "num-traits", - "pkcs1", - "pkcs8", - "rand_core", - "smallvec", - "subtle", - "zeroize", -] - -[[package]] -name = "rusticata-macros" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" -dependencies = [ - "nom", -] - -[[package]] -name = "rustix" -version = "0.38.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" -dependencies = [ - "bitflags 2.4.1", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "rustls" -version = "0.21.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" -dependencies = [ - "log", - "ring 0.17.5", - "rustls-webpki", - "sct", -] - -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.5", - "untrusted 0.9.0", -] - -[[package]] -name = "rustversion" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" - -[[package]] -name = "ryu" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "scroll" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" -dependencies = [ - "scroll_derive", -] - -[[package]] -name = "scroll_derive" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.5", - "untrusted 0.9.0", -] - -[[package]] -name = "semver" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.192" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde-transcode" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590c0e25c2a5bb6e85bf5c1bce768ceb86b316e7a01bdf07d2cb4ec2271990e2" -dependencies = [ - "serde", -] - -[[package]] -name = "serde-wasm-bindgen" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" -dependencies = [ - "js-sys", - "serde", - "wasm-bindgen", -] - -[[package]] -name = "serde_bytes" -version = "0.11.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half 1.8.2", - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.192" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "serde_json" -version = "1.0.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha-1" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug", -] - -[[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 = "signature" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" - -[[package]] -name = "simd-adler32" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" - -[[package]] -name = "simple-c2pa" -version = "0.6.0" -dependencies = [ - "anyhow", - "c2pa", - "log", - "openssl", - "ring 0.17.5", - "serde", - "serde_json", - "tempfile", -] - -[[package]] -name = "simple-c2pa-mobile" -version = "0.6.0" -dependencies = [ - "simple-c2pa", - "thiserror", - "uniffi", - "uniffi_bindgen", - "uniffi_build", -] - -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - -[[package]] -name = "smallvec" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] - -[[package]] -name = "spki" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" -dependencies = [ - "base64ct", - "der 0.5.1", -] - -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "der 0.6.1", -] - -[[package]] -name = "spki" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" -dependencies = [ - "base64ct", - "der 0.7.8", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[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.39" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "synstructure" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", - "unicode-xid", -] - -[[package]] -name = "tempfile" -version = "3.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys", -] - -[[package]] -name = "thiserror" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[package]] -name = "thread_local" -version = "1.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" -dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "tiff" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" -dependencies = [ - "flate2", - "jpeg-decoder", - "weezl", -] - -[[package]] -name = "time" -version = "0.3.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" -dependencies = [ - "deranged", - "itoa", - "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.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" -dependencies = [ - "time-core", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -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 = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - -[[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-attributes" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", -] - -[[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.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", -] - -[[package]] -name = "treeline" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" - -[[package]] -name = "twoway" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c57ffb460d7c24cd6eda43694110189030a3d1dfe418416d9468fd1c1d290b47" -dependencies = [ - "memchr", - "unchecked-index", -] - -[[package]] -name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "unchecked-index" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" - -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "uniffi" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8995f4440e0e8e27435016e2bdec264445a830a3af91a40fe3ba34b69075c5" -dependencies = [ - "anyhow", - "uniffi_build", - "uniffi_core", - "uniffi_macros", -] - -[[package]] -name = "uniffi_bindgen" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb3dfb794733803cdfeff4c09cb4e2bcecb91df6928343a18c8ee679a5772a4" -dependencies = [ - "anyhow", - "askama", - "camino", - "cargo_metadata", - "fs-err", - "glob", - "goblin", - "heck", - "once_cell", - "paste", - "serde", - "toml", - "uniffi_meta", - "uniffi_testing", - "uniffi_udl", -] - -[[package]] -name = "uniffi_build" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2334eb7cf951fb80e4883593ac8d4f09f4df522f7703fc929ae34af2cf9487b" -dependencies = [ - "anyhow", - "camino", - "uniffi_bindgen", -] - -[[package]] -name = "uniffi_checksum_derive" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819bd46e5afff09738fbd493e58c26dca0b38bca8f206ffc9a7bc2dfd7e1c11d" -dependencies = [ - "quote", - "syn 2.0.39", -] - -[[package]] -name = "uniffi_core" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "883166644d32c2e5c615c7917c8065eee1dd6ce00286b57d5ac0b362a0790422" -dependencies = [ - "anyhow", - "bytes", - "camino", - "log", - "once_cell", - "oneshot", - "paste", - "static_assertions", -] - -[[package]] -name = "uniffi_macros" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44b8de841c6b746e03e59b8476b2fa265c52f10cdad24906ec32503efe9a2421" -dependencies = [ - "bincode", - "camino", - "fs-err", - "once_cell", - "proc-macro2", - "quote", - "serde", - "syn 2.0.39", - "toml", - "uniffi_build", - "uniffi_meta", -] - -[[package]] -name = "uniffi_meta" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dc021ae8f8c12f69022f1502537687df59045e1c16f5d1eafdb657ecdb7cdf1" -dependencies = [ - "anyhow", - "bytes", - "siphasher", - "uniffi_checksum_derive", -] - -[[package]] -name = "uniffi_testing" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40fe383aca04dfbdf6a5039a9e76bb21ebb13e03e38cf1459f17c62eedee7b6c" -dependencies = [ - "anyhow", - "camino", - "cargo_metadata", - "fs-err", - "once_cell", -] - -[[package]] -name = "uniffi_udl" -version = "0.25.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6040dd1410fcb1a2795ef426f698107c12e295cc11e44a2b040934f786a35d82" -dependencies = [ - "anyhow", - "uniffi_meta", - "uniffi_testing", - "weedle2", -] - -[[package]] -name = "unsigned-varint" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fdeedbf205afadfe39ae559b75c3240f24e257d0ca27e85f85cb82aa19ac35" - -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - -[[package]] -name = "ureq" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5ccd538d4a604753ebc2f17cd9946e89b77bf87f6a8e2309667c6f2e87855e3" -dependencies = [ - "base64 0.21.5", - "flate2", - "log", - "once_cell", - "rustls", - "rustls-webpki", - "url", - "webpki-roots", -] - -[[package]] -name = "url" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "uuid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" -dependencies = [ - "getrandom", - "serde", - "wasm-bindgen", -] - -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" -dependencies = [ - "cfg-if", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.39", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.39", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" - -[[package]] -name = "web-sys" -version = "0.3.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - -[[package]] -name = "weedle2" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e79c5206e1f43a2306fd64bdb95025ee4228960f2e6c5a8b173f3caaf807741" -dependencies = [ - "nom", -] - -[[package]] -name = "weezl" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - -[[package]] -name = "x509-certificate" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf14059fbc1dce14de1d08535c411ba0b18749c2550a12550300da90b7ba350b" -dependencies = [ - "bcder", - "bytes", - "chrono", - "der 0.7.8", - "hex", - "pem", - "ring 0.16.20", - "signature", - "spki 0.7.2", - "thiserror", -] - -[[package]] -name = "x509-parser" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" -dependencies = [ - "asn1-rs", - "data-encoding", - "der-parser", - "lazy_static", - "nom", - "oid-registry", - "rusticata-macros", - "thiserror", - "time", -] - -[[package]] -name = "zeroize" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" - -[[package]] -name = "zune-inflate" -version = "0.2.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" -dependencies = [ - "simd-adler32", -] diff --git a/mobile/Cargo.toml b/mobile/Cargo.toml @@ -1,24 +0,0 @@ -[package] -name = "simple-c2pa-mobile" -version = "0.6.0" -edition = "2021" - -[dependencies] -thiserror = "1.0" -simple-c2pa = { path = "../" } -uniffi = { version = "0.25.0" } - -[build-dependencies] -uniffi = { version = "0.25.0", features = ["build"] } -uniffi_build = "0.25.0" -uniffi_bindgen = "0.25.0" - -[profile.release] -strip = true -opt-level = "z" -lto = true -codegen-units = 1 -panic = "abort" - -[lib] -crate-type = ["staticlib", "cdylib"] diff --git a/mobile/android/.gitlab-ci.yml b/mobile/android/.gitlab-ci.yml @@ -1,41 +0,0 @@ -stages: - - build - - upload - - release - -build_android: - tags: - - proofmode-macos - stage: build - script: - - make android - artifacts: - paths: - - ./mobile/android/out/ - -upload_android: - stage: upload - image: curlimages/curl:latest - script: - - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./mobile/android/out/java.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa_mobile/android-v0.${CI_PIPELINE_IID}/java.zip"' - - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./mobile/android/out/jniLibs.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa_mobile/android-v0.${CI_PIPELINE_IID}/jniLibs.zip"' - -release_android: - stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest - rules: - - if: $CI_COMMIT_TAG - when: never - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - script: - - echo "running release_android for $TAG" - release: - tag_name: "android-v0.$CI_PIPELINE_IID" - description: "android-v0.$CI_PIPELINE_IID" - ref: "$CI_COMMIT_SHA" - assets: - links: - - name: "java.zip" - url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa_mobile/android-v0.${CI_PIPELINE_IID}/java.zip" - - name: "jniLibs.zip" - url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa_mobile/android-v0.${CI_PIPELINE_IID}/jniLibs.zip" diff --git a/mobile/android/build.sh b/mobile/android/build.sh @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -MOBILE_DIR="$(pwd)/mobile" -ANDROID_DIR="${MOBILE_DIR}/android" -TARGET_DIR="${MOBILE_DIR}/target" -OUT_DIR="${ANDROID_DIR}/out" -BINDINGS_DIR="${MOBILE_DIR}/bindings" -JNILIBS_DIR="${OUT_DIR}/jniLibs" -BUILD_MODE="release" -NAME="simple_c2pa_mobile" -LIB_NAME="lib${NAME}.so" -FIXED_LIB_NAME="libuniffi_${NAME}.so" - -# build the bindings -cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" -mkdir -p ${OUT_DIR}/java -cp -r ${BINDINGS_DIR}/uniffi ${OUT_DIR}/java/ - -# build the libraries -declare -A arch_dir_map=( - ["x86_64-linux-android"]="x86_64" - ["i686-linux-android"]="x86" - ["armv7-linux-androideabi"]="armeabi-v7a" - ["aarch64-linux-android"]="arm64-v8a" -) -for architecture in "${!arch_dir_map[@]}"; do - if [ "${BUILD_MODE}" == "release" ]; then - cross build --release --manifest-path "${MOBILE_DIR}/Cargo.toml" --target "$architecture" --target-dir="${TARGET_DIR}" - else - cross build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target "$architecture" --target-dir="${TARGET_DIR}" - fi - - DESTINATION_DIR="${JNILIBS_DIR}/${arch_dir_map[$architecture]}" - mkdir -p ${DESTINATION_DIR} - cp "${TARGET_DIR}/${architecture}/${BUILD_MODE}/${LIB_NAME}" "${DESTINATION_DIR}/${FIXED_LIB_NAME}" - (cd "${OUT_DIR}" && zip -r "jniLibs.zip" "jniLibs") - (cd "${OUT_DIR}" && zip -r "java.zip" "java") -done - - diff --git a/mobile/apple/.gitlab-ci.yml b/mobile/apple/.gitlab-ci.yml @@ -1,41 +0,0 @@ -stages: - - build - - upload - - release - -build_apple: - tags: - - proofmode-macos - stage: build - script: - - make apple - artifacts: - paths: - - ./mobile/apple/out/ - -upload_apple: - stage: upload - image: curlimages/curl:latest - script: - - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./mobile/apple/out/simple_c2pa_mobile.swift "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa_mobile/apple-v0.${CI_PIPELINE_IID}/simple_c2pa_mobile.swift"' - - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./mobile/apple/out/simple_c2pa_mobile.xcframework.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa_mobile/apple-v0.${CI_PIPELINE_IID}/simple_c2pa_mobile.xcframework.zip"' - -release_apple: - stage: release - image: registry.gitlab.com/gitlab-org/release-cli:latest - rules: - - if: $CI_COMMIT_TAG - when: never - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - script: - - echo "running release_apple for $TAG" - release: - tag_name: "apple-v0.$CI_PIPELINE_IID" - description: "apple-v0.$CI_PIPELINE_IID" - ref: "$CI_COMMIT_SHA" - assets: - links: - - name: "simple_c2pa_mobile.swift" - url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa_mobile/apple-v0.${CI_PIPELINE_IID}/simple_c2pa_mobile.swift" - - name: "simple_c2pa_mobile.xcframework.zip" - url: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/simple_c2pa_mobile/apple-v0.${CI_PIPELINE_IID}/simple_c2pa_mobile.xcframework.zip" diff --git a/mobile/apple/build.sh b/mobile/apple/build.sh @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -MOBILE_DIR="$(pwd)/mobile" -APPLE_DIR="${MOBILE_DIR}/apple" -TARGET_DIR="${APPLE_DIR}/target" -OUT_DIR="${APPLE_DIR}/out" -BINDINGS_DIR="${MOBILE_DIR}/bindings" -BUILD_MODE="release" -NAME="simple_c2pa_mobile" -HEADER_PATH="${BINDINGS_DIR}/${NAME}FFI.h" -NEW_HEADER_DIR="${BINDINGS_DIR}/include" -STATIC_LIB_NAME="lib${NAME}.a" - -rustup target add aarch64-apple-ios -rustup target add x86_64-apple-ios -rustup target add aarch64-apple-ios-sim - -# build the bindings -cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target-dir="${TARGET_DIR}" - -# build the libraries -cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target aarch64-apple-darwin --release --target-dir="${TARGET_DIR}" -cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target aarch64-apple-ios --release --target-dir="${TARGET_DIR}" -cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target x86_64-apple-ios --release --target-dir="${TARGET_DIR}" -cargo build --manifest-path "${MOBILE_DIR}/Cargo.toml" --target aarch64-apple-ios-sim --release --target-dir="${TARGET_DIR}" - -mkdir -p "${NEW_HEADER_DIR}" -cp "${HEADER_PATH}" "${NEW_HEADER_DIR}/" -cp "${BINDINGS_DIR}/${NAME}FFI.modulemap" "${NEW_HEADER_DIR}/module.modulemap" - -rm -rf "${OUT_DIR}" -mkdir -p ${OUT_DIR} - -xcrun lipo -create -output "${TARGET_DIR}/simulators.a" "${TARGET_DIR}/aarch64-apple-ios-sim/${BUILD_MODE}/${STATIC_LIB_NAME}" "${TARGET_DIR}/x86_64-apple-ios/${BUILD_MODE}/${STATIC_LIB_NAME}" - -xcodebuild -create-xcframework \ - -library "${TARGET_DIR}/aarch64-apple-ios/${BUILD_MODE}/${STATIC_LIB_NAME}" \ - -headers "${NEW_HEADER_DIR}" \ - -library "${TARGET_DIR}/simulators.a" \ - -headers "${NEW_HEADER_DIR}" \ - -output "${OUT_DIR}/${NAME}.xcframework" - -(cd "${OUT_DIR}" && zip -r "${NAME}.xcframework.zip" "${NAME}.xcframework") -rm -rf "${OUT_DIR}/${NAME}.xcframework" -cp "${BINDINGS_DIR}/${NAME}.swift" "${OUT_DIR}/" diff --git a/mobile/build.rs b/mobile/build.rs @@ -1,18 +0,0 @@ -use uniffi_bindgen::bindings::TargetLanguage; - -fn main() { - let udl_file = "./src/simple-c2pa-mobile.udl"; - let out_dir = "./bindings/"; - let app_name = "simple_c2pa_mobile"; - uniffi_build::generate_scaffolding(udl_file).unwrap(); - uniffi_bindgen::generate_bindings( - udl_file.into(), - None, - vec![TargetLanguage::Swift, TargetLanguage::Kotlin], - Some(out_dir.into()), - None, - Some(app_name), - true, - ) - .unwrap(); -} diff --git a/mobile/src/lib.rs b/mobile/src/lib.rs @@ -1,89 +0,0 @@ -use simple_c2pa::{ - create_certificate, create_private_key, CertificateParams, CertificateType, ContentCredentials, -}; -use std::fs; - -uniffi::include_scaffolding!("simple-c2pa-mobile"); - -fn generate_cert(_fingerprint: String, cert_path: String, cert_key_path: String) { - let root_key = create_private_key().unwrap(); - let root_params = CertificateParams::new(root_key.clone(), CertificateType::OfflineRoot); - let root_cert = create_certificate(root_params).unwrap(); - - let content_credentials_key = create_private_key().unwrap(); - let mut content_credentials_params = CertificateParams::new( - content_credentials_key.clone(), - CertificateType::ContentCredentials, - ); - - content_credentials_params.set_parent_certificate(root_cert.clone()); - content_credentials_params.set_parent_key(root_key.clone()); - content_credentials_params.set_pgp_fingerprint(_fingerprint.to_string().clone()); - - let content_credentials_certificate = create_certificate(content_credentials_params).unwrap(); - fs::write(cert_path, content_credentials_certificate.clone()).expect("Can't save cert"); - fs::write(cert_key_path, content_credentials_key.clone()).expect("Can't save key"); -} -/* -fn add_proof_assert( - cert_path: &str, - cert_key: &str, - image_path: &str, - proof_path: &str, - output_path: &str, -) { - let content_credentials_key = fs::read_to_string(cert_key).expect("Can't load cert"); - let content_credentials_certificate = fs::read_to_string(cert_path).expect("Can't load cert"); - - let cc = ContentCredentials::new( - content_credentials_certificate.clone().to_string(), - content_credentials_key.clone().to_string(), - ); - - cc.add_proof_assertion(image_path.to_string(), output_path.to_string(), proof_data); -} -*/ -fn add_assert( - cert_path: String, - cert_key: String, - is_capture: bool, - image_path: String, - identity: String, - _fingerprint: String, - allow_machine_learning: bool, - output_path: String, -) { - let content_credentials_key = fs::read_to_string(cert_key).expect("Can't load cert"); - let content_credentials_certificate = fs::read_to_string(cert_path).expect("Can't load cert"); - - let mut cc = ContentCredentials::new( - content_credentials_certificate.clone().to_string(), - content_credentials_key.clone().to_string(), - ); - cc.set_allow_machine_learning(allow_machine_learning.clone()); - - let mut identity_tokens = identity.split("@"); - let identity_name = identity_tokens.next().unwrap().to_string(); - let identity_uri = identity_tokens.next().unwrap().to_string(); - let identity_id = identity.split("/").last().unwrap().to_string(); - - if is_capture.clone() { - cc.add_capture_assertion( - identity_uri.clone(), - identity_name.clone(), - identity_id.clone(), - image_path.to_string(), - output_path.to_string(), - ); - } else - //is import - { - cc.add_import_assertion( - identity_uri.clone(), - identity_name.clone(), - identity_id.clone(), - image_path.to_string(), - output_path.to_string(), - ); - } -} diff --git a/mobile/src/simple-c2pa-mobile.udl b/mobile/src/simple-c2pa-mobile.udl @@ -1,5 +0,0 @@ -namespace simple_c2pa_mobile { - void generate_cert(string fingerprint, string cert_path, string cert_key_path); - - void add_assert(string cert_path, string cert_key, boolean is_capture, string image_path, string identity, string fingerprint, boolean allow_machine_learning, string output_path); -}; diff --git a/src/assertions.rs b/src/assertions.rs @@ -0,0 +1,311 @@ +use crate::common::SimpleC2PAError; +use crate::content_credentials::ContentCredentials; +use c2pa::assertions::{c2pa_action, labels, Action, Actions, Exif, SchemaDotOrg}; +use serde::{Deserialize, Serialize}; +use std::result::Result; +use std::sync::Arc; + +#[derive(uniffi::Object)] +pub struct ExifData { + pub gps_version_id: Option<String>, + pub latitude: Option<String>, + pub longitude: Option<String>, + pub altitude_ref: Option<u8>, + pub altitude: Option<String>, + pub timestamp: Option<String>, + pub speed_ref: Option<String>, + pub speed: Option<String>, + pub direction_ref: Option<String>, + pub direction: Option<String>, + pub destination_bearing_ref: Option<String>, + pub destination_bearing: Option<String>, + pub positioning_error: Option<String>, + pub exposure_time: Option<String>, + pub f_number: Option<f64>, + pub color_space: Option<u8>, + pub digital_zoom_ratio: Option<f64>, + pub make: Option<String>, + pub model: Option<String>, + pub lens_make: Option<String>, + pub lens_model: Option<String>, + pub lens_specification: Option<Vec<f64>>, +} + +#[uniffi::export] +impl ExifData { + #[uniffi::constructor] + pub fn new() -> Arc<Self> { + Arc::new(ExifData { + gps_version_id: None, + latitude: None, + longitude: None, + altitude_ref: None, + altitude: None, + timestamp: None, + speed_ref: None, + speed: None, + direction_ref: None, + direction: None, + destination_bearing_ref: None, + destination_bearing: None, + positioning_error: None, + exposure_time: None, + f_number: None, + color_space: None, + digital_zoom_ratio: None, + make: None, + model: None, + lens_make: None, + lens_model: None, + lens_specification: None, + }) + } +} + +#[derive(Serialize, Deserialize, Clone)] +#[serde(rename_all = "camelCase")] +struct AIDataMiningUsageJSON { + r#use: String, + r#constraint_info: Option<String>, +} + +#[derive(uniffi::Enum)] +pub enum AIDataMiningUsage { + Allowed, + NotAllowed, + Constrained { constraint_info: String }, +} + +#[derive(uniffi::Record)] +pub struct CustomAITrainingOptions { + pub ai_training: AIDataMiningUsage, + pub ai_generative_training: AIDataMiningUsage, + pub data_mining: AIDataMiningUsage, + pub inference: AIDataMiningUsage, +} + +impl AIDataMiningUsage { + fn to_json(&self) -> AIDataMiningUsageJSON { + match self { + AIDataMiningUsage::Allowed => { + return AIDataMiningUsageJSON { + r#use: "allowed".to_owned(), + r#constraint_info: None, + }; + } + AIDataMiningUsage::NotAllowed => { + return AIDataMiningUsageJSON { + r#use: "notAllowed".to_owned(), + r#constraint_info: None, + }; + } + AIDataMiningUsage::Constrained { constraint_info } => { + return AIDataMiningUsageJSON { + r#use: "constrained".to_owned(), + r#constraint_info: Some(constraint_info.to_owned()), + }; + } + } + } +} + +fn get_creative_work_assertion( + name: String, + identifier: String, + id: String, +) -> Result<SchemaDotOrg, SimpleC2PAError> { + let person = SchemaDotOrg::new("Person".to_owned()) + .set_default_context() + .insert("name".to_owned(), name.to_owned())? + .insert("identifier".to_owned(), identifier.to_owned())? + .insert("@id".to_owned(), id.to_owned())?; + + let work = SchemaDotOrg::new("CreativeWork".to_owned()) + .set_default_context() + .insert("author".to_owned(), vec![person.clone()])?; + Ok(work) +} + +fn get_actions_assertion(action: String) -> Result<Actions, SimpleC2PAError> { + let action = Action::new(action.as_str()); + let actions = Actions::new().add_action(action); + Ok(actions) +} + +#[uniffi::export] +impl ContentCredentials { + pub fn add_created_assertion(&self) -> Result<(), SimpleC2PAError> { + let actions = get_actions_assertion(c2pa_action::CREATED.to_string())?; + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_assertion(&actions)?; + Ok(()) + } + + pub fn add_placed_assertion(&self) -> Result<(), SimpleC2PAError> { + let actions = get_actions_assertion(c2pa_action::PLACED.to_string())?; + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_assertion(&actions)?; + Ok(()) + } + + pub fn add_email_assertion( + &self, + email: String, + display_name: String, + ) -> Result<(), SimpleC2PAError> { + Ok(()) + } + + pub fn add_instagram_assertion( + &self, + username: String, + display_name: String, + ) -> Result<(), SimpleC2PAError> { + let work = get_creative_work_assertion( + display_name.to_owned(), + username.to_owned(), + "https://instagram.com".to_owned(), + )?; + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_labeled_assertion(labels::CREATIVE_WORK, &work)?; + Ok(()) + } + + pub fn add_pgp_assertion( + &self, + fingerprint: String, + display_name: String, + ) -> Result<(), SimpleC2PAError> { + let work = get_creative_work_assertion( + display_name.to_owned(), + fingerprint.to_owned(), + "https://keys.openpgp.org".to_owned(), + )?; + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_labeled_assertion(labels::CREATIVE_WORK, &work)?; + Ok(()) + } + + pub fn add_website_assertion(&self, url: String) -> Result<(), SimpleC2PAError> { + let work = SchemaDotOrg::new("CreativeWork".to_owned()) + .set_default_context() + .insert("url".to_owned(), url)?; + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_labeled_assertion(labels::CREATIVE_WORK, &work)?; + Ok(()) + } + + pub fn add_exif_assertion(&self, exif_data: Arc<ExifData>) -> Result<(), SimpleC2PAError> { + let mut exif = Exif::new(); + if let Some(gps_version_id) = exif_data.gps_version_id.clone() { + exif = exif.insert("exif:GPSVersionID", gps_version_id)?; + } + if let Some(latitude) = exif_data.latitude.clone() { + exif = exif.insert("exif:GPSLatitude", latitude)?; + } + if let Some(longitude) = exif_data.longitude.clone() { + exif = exif.insert("exif:GPSLongitude", longitude)?; + } + if let Some(altitude_ref) = exif_data.altitude_ref { + exif = exif.insert("exif:GPSAltitudeRef", altitude_ref)?; + } + if let Some(altitude) = exif_data.altitude.clone() { + exif = exif.insert("exif:GPSAltitude", altitude)?; + } + if let Some(timestamp) = exif_data.timestamp.clone() { + exif = exif.insert("exif:GPSTimeStamp", timestamp)?; + } + if let Some(speed_ref) = exif_data.speed_ref.clone() { + exif = exif.insert("exif:GPSSpeedRef", speed_ref)?; + } + if let Some(speed) = exif_data.speed.clone() { + exif = exif.insert("exif:GPSSpeed", speed)?; + } + if let Some(direction_ref) = exif_data.direction_ref.clone() { + exif = exif.insert("exif:GPSImgDirectionRef", direction_ref)?; + } + if let Some(direction) = exif_data.direction.clone() { + exif = exif.insert("exif:GPSImgDirection", direction)?; + } + if let Some(destination_bearing_ref) = exif_data.destination_bearing_ref.clone() { + exif = exif.insert("exif:GPSDestBearingRef", destination_bearing_ref)?; + } + if let Some(destination_bearing) = exif_data.destination_bearing.clone() { + exif = exif.insert("exif:GPSDestBearing", destination_bearing)?; + } + if let Some(positioning_error) = exif_data.positioning_error.clone() { + exif = exif.insert("exif:GPSHPositioningError", positioning_error)?; + } + if let Some(exposure_time) = exif_data.exposure_time.clone() { + exif = exif.insert("exif:ExposureTime", exposure_time)?; + } + if let Some(f_number) = exif_data.f_number { + exif = exif.insert("exif:FNumber", f_number)?; + } + if let Some(color_space) = exif_data.color_space { + exif = exif.insert("exif:ColorSpace", color_space)?; + } + if let Some(digital_zoom_ratio) = exif_data.digital_zoom_ratio { + exif = exif.insert("exif:DigitalZoomRatio", digital_zoom_ratio)?; + } + if let Some(make) = exif_data.make.clone() { + exif = exif.insert("tiff:Make", make)?; + } + if let Some(model) = exif_data.model.clone() { + exif = exif.insert("tiff:Model", model)?; + } + if let Some(lens_make) = exif_data.lens_make.clone() { + exif = exif.insert("exifEX:LensMake", lens_make)?; + } + if let Some(lens_model) = exif_data.lens_model.clone() { + exif = exif.insert("exifEX:LensModel", lens_model)?; + } + if let Some(lens_specification) = exif_data.lens_specification.clone() { + exif = exif.insert("exifEX:LensSpecification", lens_specification)?; + } + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_assertion(&exif)?; + Ok(()) + } + + pub fn add_json_assertion(&self, label: String, json: String) -> Result<(), SimpleC2PAError> { + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_labeled_assertion(label, &json)?; + Ok(()) + } + + pub fn add_restricted_ai_training_assertions(&self) -> Result<(), SimpleC2PAError> { + let training_not_allowed = AIDataMiningUsage::NotAllowed.to_json(); + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_labeled_assertion("c2pa.ai_training", &training_not_allowed)?; + manifest.add_labeled_assertion("c2pa.ai_generative_training", &training_not_allowed)?; + manifest.add_labeled_assertion("c2pa.data_mining", &training_not_allowed)?; + manifest.add_labeled_assertion("c2pa.inference", &training_not_allowed)?; + Ok(()) + } + + pub fn add_permissive_ai_training_assertions(&self) -> Result<(), SimpleC2PAError> { + let training_allowed = AIDataMiningUsage::Allowed.to_json(); + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_labeled_assertion("c2pa.ai_training", &training_allowed)?; + manifest.add_labeled_assertion("c2pa.ai_generative_training", &training_allowed)?; + manifest.add_labeled_assertion("c2pa.data_mining", &training_allowed)?; + manifest.add_labeled_assertion("c2pa.inference", &training_allowed)?; + Ok(()) + } + + pub fn add_custom_ai_training_assertions( + &self, + options: CustomAITrainingOptions, + ) -> Result<(), SimpleC2PAError> { + let mut manifest = self.manifest.lock().unwrap(); + manifest.add_labeled_assertion("c2pa.ai_training", &options.ai_training.to_json())?; + manifest.add_labeled_assertion( + "c2pa.ai_generative_training", + &options.ai_generative_training.to_json(), + )?; + manifest.add_labeled_assertion("c2pa.data_mining", &options.data_mining.to_json())?; + manifest.add_labeled_assertion("c2pa.inference", &options.inference.to_json())?; + Ok(()) + } +} diff --git a/src/bin/uniffi-bindgen.rs b/src/bin/uniffi-bindgen.rs @@ -0,0 +1,5 @@ +use uniffi; + +fn main() { + uniffi::uniffi_bindgen_main() +} diff --git a/src/certificates.rs b/src/certificates.rs @@ -1,4 +1,4 @@ -use anyhow::Result; +use crate::common::{FileData, SimpleC2PAError}; use openssl::asn1::Asn1Integer; use openssl::bn::BigNum; use openssl::ec::{EcGroup, EcKey}; @@ -10,101 +10,153 @@ use openssl::x509::extension::{ }; use openssl::x509::{X509Name, X509NameBuilder, X509}; use ring::rand::SecureRandom; +use std::result::Result; +use std::sync::Arc; -pub fn create_private_key() -> Result<String> { +#[uniffi::export] +pub fn create_private_key() -> Result<Arc<FileData>, SimpleC2PAError> { let group = EcGroup::from_curve_name(Nid::X9_62_PRIME256V1)?; let ec_key = EcKey::generate(&group)?; let key = PKey::from_ec_key(ec_key)?; let key_pem = key.private_key_to_pem_pkcs8()?; - let key_pem_str = String::from_utf8(key_pem.clone())?; - - return Ok(key_pem_str); + let file = FileData::new(None, Some(key_pem.clone()), None); + Ok(file) } -const DEFAULT_ORGANIZATION: &str = "ProofMode"; +const DEFAULT_ORGANIZATION: &str = "SimpleC2PA"; -#[derive(Clone, Debug)] +#[derive(Debug, Clone, uniffi::Enum)] pub enum CertificateType { - OnlineRoot, - OnlineIntermediate, - OfflineRoot, - ContentCredentials, + OnlineRoot { + organization: Option<String>, + validity_days: Option<u32>, + }, + OnlineIntermediate { + organization: Option<String>, + validity_days: Option<u32>, + }, + OfflineRoot { + organization: Option<String>, + validity_days: Option<u32>, + }, + OfflineIntermediate { + organization: Option<String>, + validity_days: Option<u32>, + }, + ContentCredentials { + organization: Option<String>, + validity_days: Option<u32>, + }, +} + +fn format_certificate_name(org: Option<String>, name: String) -> String { + format!( + "{} {}", + org.unwrap_or(DEFAULT_ORGANIZATION.to_owned()), + name + ) } impl CertificateType { - fn to_common_name(&self) -> String { + fn is_ca(&self) -> bool { match self { - CertificateType::OnlineRoot => "ProofMode Root CA".to_string(), - CertificateType::OnlineIntermediate => "ProofMode Intermediate CA".to_string(), - CertificateType::OfflineRoot => "ProofMode Offline Root CA".to_string(), - CertificateType::ContentCredentials => "ProofMode Content Credentials".to_string(), + CertificateType::OnlineRoot { .. } => true, + CertificateType::OnlineIntermediate { .. } => true, + CertificateType::OfflineRoot { .. } => true, + CertificateType::OfflineIntermediate { .. } => true, + CertificateType::ContentCredentials { .. } => false, } } fn validity_days(&self) -> u32 { match self { - CertificateType::OnlineRoot => 365 * 20, - CertificateType::OnlineIntermediate => 365 * 20, - CertificateType::OfflineRoot => 365 * 20, - CertificateType::ContentCredentials => 365, + CertificateType::OnlineRoot { validity_days, .. } => validity_days.unwrap_or(365 * 20), + CertificateType::OnlineIntermediate { validity_days, .. } => { + validity_days.unwrap_or(365 * 20) + } + CertificateType::OfflineRoot { validity_days, .. } => validity_days.unwrap_or(365 * 20), + CertificateType::OfflineIntermediate { validity_days, .. } => { + validity_days.unwrap_or(365 * 20) + } + CertificateType::ContentCredentials { validity_days, .. } => { + validity_days.unwrap_or(365) + } } } - fn is_ca(&self) -> bool { + fn to_common_name(&self) -> String { match self { - CertificateType::OnlineRoot => true, - CertificateType::OnlineIntermediate => true, - CertificateType::OfflineRoot => true, - CertificateType::ContentCredentials => false, + CertificateType::OnlineRoot { organization, .. } => { + format_certificate_name(organization.clone(), "Root CA".to_string()) + } + CertificateType::OnlineIntermediate { organization, .. } => { + format_certificate_name(organization.clone(), "Intermediate CA".to_string()) + } + CertificateType::OfflineRoot { organization, .. } => { + format_certificate_name(organization.clone(), "Offline Root CA".to_string()) + } + CertificateType::OfflineIntermediate { organization, .. } => { + format_certificate_name(organization.clone(), "Offline Intermediate CA".to_string()) + } + CertificateType::ContentCredentials { organization, .. } => { + format_certificate_name(organization.clone(), "Content Credentials".to_string()) + } } } } -#[derive(Clone, Debug)] -pub struct CertificateParams { - key: String, +#[derive(Clone, Debug, uniffi::Object)] +pub struct CertificateOptions { + key: Arc<FileData>, certificate_type: CertificateType, - parent_key: Option<String>, - parent_certificate: Option<String>, + parent_certificate: Option<Arc<Certificate>>, email_address: Option<String>, pgp_fingerprint: Option<String>, } -impl CertificateParams { - pub fn new(key: String, certificate_type: CertificateType) -> Self { - Self { +#[uniffi::export] +impl CertificateOptions { + #[uniffi::constructor] + pub fn new( + key: Arc<FileData>, + certificate_type: CertificateType, + parent_certificate: Option<Arc<Certificate>>, + email_address: Option<String>, + pgp_fingerprint: Option<String>, + ) -> Arc<CertificateOptions> { + Arc::new(CertificateOptions { key, certificate_type, - parent_key: None, - parent_certificate: None, - email_address: None, - pgp_fingerprint: None, - } - } - - pub fn set_parent_key(&mut self, parent_key: String) { - self.parent_key = Some(parent_key); - } - - pub fn set_parent_certificate(&mut self, parent_certificate: String) { - self.parent_certificate = Some(parent_certificate); + parent_certificate, + email_address, + pgp_fingerprint, + }) } +} - pub fn set_email_address(&mut self, email_address: String) { - self.email_address = Some(email_address); - } +#[derive(Clone, Debug, uniffi::Object)] +pub struct Certificate { + pub certificate_data: Arc<FileData>, + pub private_key_data: Arc<FileData>, + pub parent_certificate: Option<Arc<Certificate>>, +} - pub fn set_pgp_fingerprint(&mut self, fingerprint: String) { - let clean_fingerprint = fingerprint - .replace("\u{a0}", " ") - .replace("\u{a20}", " ") - .replace(" ", "") - .to_ascii_uppercase(); - self.pgp_fingerprint = Some(clean_fingerprint); +#[uniffi::export] +impl Certificate { + #[uniffi::constructor] + pub fn new( + certificate_data: Arc<FileData>, + private_key_data: Arc<FileData>, + parent_certificate: Option<Arc<Certificate>>, + ) -> Arc<Self> { + Arc::new(Certificate { + certificate_data, + private_key_data, + parent_certificate, + }) } } - -fn generate_serial_number() -> Result<Asn1Integer> { +fn generate_serial_number() -> Result<Asn1Integer, SimpleC2PAError> { let random = ring::rand::SystemRandom::new(); let mut serial_number_bytes = [0u8; 20]; let _ = random.fill(&mut serial_number_bytes); @@ -114,12 +166,12 @@ fn generate_serial_number() -> Result<Asn1Integer> { return Ok(serial_number); } -fn create_name(params: CertificateParams) -> Result<X509Name> { +fn create_name(options: Arc<CertificateOptions>) -> Result<X509Name, SimpleC2PAError> { let mut name_builder = X509NameBuilder::new()?; - name_builder.append_entry_by_text("CN", &params.certificate_type.to_common_name())?; + name_builder.append_entry_by_text("CN", &options.certificate_type.to_common_name())?; name_builder.append_entry_by_text("O", DEFAULT_ORGANIZATION)?; - if let Some(email_address) = params.email_address { + if let Some(email_address) = options.email_address.clone() { name_builder.append_entry_by_text("emailAddress", &email_address)?; } @@ -128,18 +180,20 @@ fn create_name(params: CertificateParams) -> Result<X509Name> { return Ok(name); } -pub fn create_certificate(params: CertificateParams) -> Result<String> { - let name_params = params.clone(); +#[uniffi::export] +pub fn create_certificate( + options: Arc<CertificateOptions>, +) -> Result<Arc<Certificate>, SimpleC2PAError> { let serial_number = generate_serial_number()?; - let private_key = PKey::private_key_from_pem(params.key.as_bytes())?; - let is_ca = params.certificate_type.is_ca(); - let name = create_name(name_params)?; + let private_key = PKey::private_key_from_pem(&options.key.get_bytes()?)?; + let is_ca = options.certificate_type.is_ca(); + let name = create_name(options.clone())?; let mut cert_builder = X509::builder()?; cert_builder.set_version(2)?; cert_builder.set_subject_name(&name)?; - if let Some(parent_certificate) = params.parent_certificate.clone() { - let parent_cert = X509::from_pem(parent_certificate.as_bytes())?; + if let Some(parent_certificate) = options.parent_certificate.clone() { + let parent_cert = X509::from_pem(&parent_certificate.certificate_data.get_bytes()?)?; cert_builder.set_issuer_name(parent_cert.subject_name())?; } else { cert_builder.set_issuer_name(&name)?; @@ -149,12 +203,12 @@ pub fn create_certificate(params: CertificateParams) -> Result<String> { let not_before = openssl::asn1::Asn1Time::days_from_now(0)?; let not_after = - openssl::asn1::Asn1Time::days_from_now(params.certificate_type.validity_days())?; + openssl::asn1::Asn1Time::days_from_now(options.certificate_type.validity_days())?; cert_builder.set_not_before(&not_before)?; cert_builder.set_not_after(&not_after)?; let mut basic_constraints = BasicConstraints::new(); - if params.certificate_type.is_ca() { + if options.certificate_type.is_ca() { basic_constraints.critical().ca(); } cert_builder.append_extension(basic_constraints.build()?)?; @@ -185,34 +239,32 @@ pub fn create_certificate(params: CertificateParams) -> Result<String> { cert_builder.append_extension(extended_key_usage)?; } - /* - if let Some(fingerprint) = params.pgp_fingerprint { - let formatted_fingerprint = format!("PGP-Fingerprint-{}", fingerprint); - println!("Fingerprint: {}", formatted_fingerprint); - let san = SubjectAlternativeName::new() - .rid(&formatted_fingerprint) - .build(&cert_builder.x509v3_context(None, None))?; - println!("SAN"); - cert_builder.append_extension(san)?; - } - */ - - if let Some(parent_key) = params.parent_key { - let parent_private_key = PKey::private_key_from_pem(parent_key.as_bytes())?; + let mut certificate_chain = vec![]; + if let Some(ref parent_certificate) = options.parent_certificate { + let parent_private_key = + PKey::private_key_from_pem(&parent_certificate.private_key_data.get_bytes()?)?; cert_builder.sign(&parent_private_key, MessageDigest::sha512())?; + certificate_chain.push(parent_certificate); } else { cert_builder.sign(&private_key, MessageDigest::sha512())?; } - let certificate = cert_builder.build(); - let pem = String::from_utf8(certificate.to_pem()?)?; - let mut all_certificates = vec![pem.clone()]; - if let Some(certificate) = params.parent_certificate { - all_certificates.push(certificate); - } - let certificate_chain = all_certificates.join(""); + let x509 = cert_builder.build(); + let file_data = FileData::new(None, Some(x509.to_pem()?), None); + let certificate = Certificate::new( + file_data.clone(), + options.key.clone(), + options.parent_certificate.clone(), + ); + + Ok(certificate) +} - return Ok(certificate_chain); +#[uniffi::export] +pub fn request_signed_certificate( + _options: Arc<CertificateOptions>, +) -> Result<String, SimpleC2PAError> { + Ok("not yet implemented".to_string()) } /* diff --git a/src/common.rs b/src/common.rs @@ -0,0 +1,104 @@ +use openssl::error::ErrorStack; +use std::fs; +use std::io::Write; +use std::result::Result; +use std::sync::Arc; +use tempfile::{NamedTempFile, PersistError}; +use thiserror::Error; + +#[derive(Debug, Clone, uniffi::Object)] +pub struct FileData { + path: Option<String>, + bytes: Option<Vec<u8>>, + file_name: Option<String>, +} + +#[uniffi::export] +impl FileData { + #[uniffi::constructor] + pub fn new( + path: Option<String>, + bytes: Option<Vec<u8>>, + file_name: Option<String>, + ) -> Arc<Self> { + Arc::new(FileData { + path, + bytes, + file_name, + }) + } + + pub fn get_bytes(&self) -> Result<Vec<u8>, SimpleC2PAError> { + if let Some(bytes) = &self.bytes { + return Ok(bytes.clone()); + } + + if let Some(path) = &self.path { + return Ok(fs::read(path)?); + } + + return Err(SimpleC2PAError::Failure { + message: "No bytes or path".to_owned(), + }); + } + + pub fn get_path(&self) -> Result<String, SimpleC2PAError> { + if let Some(path) = &self.path { + return Ok(path.clone()); + } + + if let Some(bytes) = &self.bytes { + let mut file = NamedTempFile::new()?; + file.write_all(bytes)?; + let file_name = &self.file_name.clone().unwrap_or("file".to_owned()); + let path = format!("/tmp/{}", file_name); + file.persist(path.clone())?; + return Ok(path.clone()); + } + + return Err(SimpleC2PAError::Failure { + message: "No bytes or path".to_owned(), + }); + } +} + +#[derive(Error, Debug, uniffi::Error)] +pub enum SimpleC2PAError { + #[error("Failed with message: {message}")] + Failure { message: String }, + + #[error("unexpected id: {id}")] + Unexpected { id: i32 }, +} + +impl From<std::io::Error> for SimpleC2PAError { + fn from(error: std::io::Error) -> Self { + SimpleC2PAError::Failure { + message: error.to_string(), + } + } +} + +impl From<PersistError> for SimpleC2PAError { + fn from(error: PersistError) -> Self { + SimpleC2PAError::Failure { + message: error.to_string(), + } + } +} + +impl From<ErrorStack> for SimpleC2PAError { + fn from(error: ErrorStack) -> Self { + SimpleC2PAError::Failure { + message: error.to_string(), + } + } +} + +impl From<c2pa::Error> for SimpleC2PAError { + fn from(error: c2pa::Error) -> Self { + SimpleC2PAError::Failure { + message: error.to_string(), + } + } +} diff --git a/src/content_credentials.rs b/src/content_credentials.rs @@ -1,237 +1,88 @@ -use anyhow::Result; -use c2pa::{ - assertions::{ - c2pa_action, labels, Action, Actions, SchemaDotOrg, SchemaDotOrgPerson, SoftwareAgent, - }, - create_signer, Ingredient, Manifest, SigningAlg, -}; +use crate::certificates::{self, Certificate}; +use crate::common::{FileData, SimpleC2PAError}; +use c2pa::{create_signer, Ingredient, Manifest, SigningAlg}; use log::debug; -use serde::{Deserialize, Serialize}; -use std::collections::HashMap; +use std::fmt::{Display, Formatter, Result as FmtResult}; +use std::path::PathBuf; +use std::result::Result; +use std::sync::{Arc, Mutex}; use std::vec; +use tempfile::NamedTempFile; -#[derive(Serialize, Deserialize, Clone)] -#[serde(rename_all = "camelCase")] -struct ProofCheckJSON { - #[serde(alias = "fileType")] - file_type: String, - #[serde(alias = "relatedFiles")] - related_files: HashMap<String, serde_json::Value>, - integrity: HashMap<String, serde_json::Value>, - thumbnail: String, -} - -#[derive(Serialize, Deserialize, Clone)] -#[serde(rename_all = "camelCase")] -struct ProofModeJSON { - #[serde(alias = "DeviceID")] - device_id: String, -} +const APPLICATION_NAME: &str = "Simple-C2PA"; +const APPLICATION_VERSION: &str = env!("CARGO_PKG_VERSION"); -enum ProofJSON { - ProofMode(ProofModeJSON), - ProofCheck(ProofCheckJSON), +#[derive(Debug, Clone, uniffi::Object)] +pub struct ApplicationInfo { + pub name: String, + pub version: String, + pub icon_uri: Option<String>, } -impl ProofJSON { - pub fn to_json_value(&self) -> serde_json::Result<serde_json::Value> { - match self { - ProofJSON::ProofMode(data) => serde_json::to_value(data), - ProofJSON::ProofCheck(data) => serde_json::to_value(data), - } +#[uniffi::export] +impl ApplicationInfo { + #[uniffi::constructor] + pub fn new(name: String, version: String, icon_uri: Option<String>) -> Arc<Self> { + Arc::new(ApplicationInfo { + name, + version, + icon_uri, + }) } } -#[derive(Serialize, Deserialize, Clone)] -#[serde(rename_all = "camelCase")] -struct TrainingNotAllowedJSON { - r#use: String, -} - -#[derive(Serialize, Deserialize, Clone)] -#[serde(rename_all = "camelCase")] -struct TrainingConstrainedJSON { - r#use: String, - r#constraint_info: String, +impl Display for ApplicationInfo { + fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult { + write!(f, "{}/{}", self.name, self.version) + } } -const GENERATOR: &str = concat!("ProofMode/", env!("CARGO_PKG_VERSION")); - -#[derive(Debug)] +#[derive(Debug, uniffi::Object)] pub struct ContentCredentials { - certificate: String, - private_key: String, - socials: Option<Vec<String>>, - pgp_fingerprint: Option<String>, - allow_machine_learning: bool, + certificate: Arc<Certificate>, + file: Arc<FileData>, + application_info: Arc<ApplicationInfo>, + pub(crate) manifest: Mutex<Manifest>, } +#[uniffi::export] impl ContentCredentials { - pub fn new(certificate: String, private_key: String) -> Self { - ContentCredentials { - certificate, - private_key, - socials: None, - pgp_fingerprint: None, - allow_machine_learning: false, - } - } - - pub fn set_socials(&mut self, socials: Vec<String>) { - self.socials = Some(socials); - } - - pub fn set_pgp_fingerprint(&mut self, pgp_fingerprint: String) { - self.pgp_fingerprint = Some(pgp_fingerprint); - } - - pub fn set_allow_machine_learning(&mut self, allow_machine_learning: bool) { - self.allow_machine_learning = allow_machine_learning; - } - - pub fn add_capture_assertion( - &self, - identity_uri: String, - identity_name: String, - identity_id: String, - input_path: String, - output_path: String, - ) { - println!("Capture"); - let result = match self.add_assertion( - c2pa_action::CREATED, - &identity_uri, - &identity_name, - &identity_id, - input_path.to_string(), - output_path.to_string(), + #[uniffi::constructor] + pub fn new( + certificate: Arc<Certificate>, + file: Arc<FileData>, + application_info: Option<Arc<ApplicationInfo>>, + ) -> Arc<Self> { + let app_info = application_info.unwrap_or(ApplicationInfo::new( + APPLICATION_NAME.to_owned(), + APPLICATION_VERSION.to_owned(), None, - ) { - Ok(res) => format!("Output: {}", res), - Err(e) => format!("Error: {}", e), - }; - } - - pub fn add_import_assertion( - &self, - identity_uri: String, - identity_name: String, - identity_id: String, - input_path: String, - output_path: String, - ) { - println!("Import"); - let result = match self.add_assertion( - c2pa_action::PLACED, - &identity_uri, - &identity_name, - &identity_id, - input_path.to_string(), - output_path.to_string(), - None, - ) { - Ok(res) => format!("Output: {}", res), - Err(e) => format!("Error: {}", e), - }; - } - - pub fn add_proof_assertion(&self, file_path: String, output_path: String, json: String) { - println!("Prove"); - let parsed_json = - serde_json::from_str::<ProofModeJSON>(&json).expect("JSON was not well-formatted"); - let result = match self.add_assertion( - "org.proofmode.proofmode_data_added", - "", - "", - "", - file_path, - output_path, - Some(ProofJSON::ProofMode(parsed_json)), - ) { - Ok(res) => format!("Output: {}", res), - Err(e) => format!("Error: {}", e), - }; - } + )); + let path = file.get_path().unwrap(); + println!("{:?}", path); + let mut ingredient = Ingredient::from_file(path).unwrap(); + ingredient + .set_thumbnail("image/jpeg", file.get_bytes().unwrap()) + .unwrap(); + let claim_generator = app_info.to_string(); + let mut manifest = Manifest::new(claim_generator); + manifest.set_parent(ingredient).unwrap(); - pub fn add_check_assertion(&self, file_path: String, output_path: String, json: String) { - println!("Check"); - let parsed_json = - serde_json::from_str::<ProofCheckJSON>(&json).expect("JSON was not well-formatted"); - let result = match self.add_assertion( - "org.proofmode.proofcheck_data_added", - "https://proofcheck.gpfs.link", - "ProofCheck Service", - "ProofCheck", - file_path, - output_path, - Some(ProofJSON::ProofCheck(parsed_json)), - ) { - Ok(res) => format!("Output: {}", res), - Err(e) => format!("Error: {}", e), - }; + Arc::new(ContentCredentials { + certificate, + file, + application_info: app_info, + manifest: Mutex::new(manifest), + }) } - fn add_assertion( + fn sign_manifest_with_certificate( &self, - action: &str, - identity_uri: &str, - identity_name: &str, - identity_id: &str, - media_file_path: String, - output_file_path: String, - json: Option<ProofJSON>, - ) -> Result<String> { - debug!("loading c2pa ingredients from parent file"); - let parent = Ingredient::from_file(&media_file_path)?; - let action = Action::new(action); - let agent = SoftwareAgent::String(GENERATOR.to_owned()); - action.clone().set_software_agent(agent); - - debug!("adding c2pa: person"); - let original_person = SchemaDotOrgPerson::new() - .set_name(identity_name.to_owned()) - .unwrap() - .set_identifier(identity_id.to_owned()) - .unwrap() - .insert("@id".to_owned(), identity_uri.to_owned()) - .unwrap(); - - debug!("adding c2pa: creativework"); - let original = SchemaDotOrg::new("CreativeWork".to_owned()) - .set_default_context() - .insert("author".to_owned(), vec![original_person.clone()])?; - let actions = Actions::new().add_action(action); - let mut manifest = Manifest::new(GENERATOR.to_owned()); - manifest.set_parent(parent)?; - manifest.add_assertion(&actions)?; - manifest.add_labeled_assertion(labels::CREATIVE_WORK, &original)?; - - if json.is_some() { - debug!("adding c2pa: proofmode json"); - let json = json.unwrap().to_json_value().unwrap(); - manifest.add_labeled_assertion("org.proofmode.proof", &json)?; - } - - if !self.allow_machine_learning { - debug!("adding c2pa: training"); - let training_not_allowed: TrainingNotAllowedJSON = TrainingNotAllowedJSON { - r#use: "notAllowed".to_owned(), - }; - - let training_constrained: TrainingConstrainedJSON = TrainingConstrainedJSON { - r#use : "constrained".to_owned(), - r#constraint_info : "may only be mined for purposes of content verification or in coordination with creator and original intent and purposes".to_owned() - }; - manifest.add_labeled_assertion("c2pa.ai_training", &training_not_allowed)?; - manifest.add_labeled_assertion("c2pa.ai_generative_training", &training_not_allowed)?; - manifest.add_labeled_assertion("c2pa.data_mining", &training_constrained)?; - manifest.add_labeled_assertion("c2pa.inference", &training_not_allowed)?; - } - let clean_cert = self.certificate.clone(); - let signcert = clean_cert.as_bytes(); - - let clean_pkey = self.private_key.clone(); - let pkey = clean_pkey.as_bytes(); + certificate: Arc<Certificate>, + output_file: Arc<FileData>, + ) -> Result<(), SimpleC2PAError> { + let cert = certificate.certificate_data.get_bytes()?; + let pkey = certificate.private_key_data.get_bytes()?; let algorithms = vec![ SigningAlg::Es256, SigningAlg::Es384, @@ -241,16 +92,21 @@ impl ContentCredentials { SigningAlg::Ps512, SigningAlg::Ed25519, ]; - debug!("adding c2pa: signing"); + println!("adding c2pa: signing"); for alg in algorithms { debug!("Trying algorithm {:?}... ", alg); - let signer = create_signer::from_keys(&signcert, &pkey, alg, None); - debug!("embedding manifest using signer"); + let signer = create_signer::from_keys(&cert, &pkey, alg, None); + println!("embedding manifest using signer"); match signer { Ok(signer) => { - match manifest.embed(&media_file_path, &output_file_path, signer.as_ref()) { + let mut manifest = self.manifest.lock().unwrap(); + match manifest.embed( + &self.file.get_path()?, + &output_file.get_path()?, + signer.as_ref(), + ) { Ok(_) => { - debug!("Using provided certificate and private key"); + println!("Using provided certificate and private key"); break; } Err(err) => { @@ -260,12 +116,56 @@ impl ContentCredentials { } } Err(err) => { - debug!("failed: {}\n", err); + println!("failed: {}\n", err); continue; } }; } + Ok(()) + } + + fn sign_manifest( + &self, + embed: bool, + output_path: Option<String>, + ) -> Result<Arc<FileData>, SimpleC2PAError> { + let temp_path = NamedTempFile::new()?.path().to_path_buf(); + // let output_path = PathBuf::from(output_path.clone()) // .unwrap_or(temp_path); + let output_file = FileData::new(output_path.clone(), None, None); + if !embed { + let mut manifest = self.manifest.lock().unwrap(); + manifest.set_sidecar_manifest(); + } + + self.sign_manifest_with_certificate(self.certificate.clone(), output_file.clone())?; + Ok(output_file) + } + + pub fn embed_manifest( + &self, + output_path: Option<String>, + ) -> Result<Arc<FileData>, SimpleC2PAError> { + self.sign_manifest(true, output_path) + } + + pub fn export_manifest( + &self, + output_path: Option<String>, + ) -> Result<Arc<FileData>, SimpleC2PAError> { + self.sign_manifest(false, output_path) + } +} + +#[derive(Debug, Clone, uniffi::Enum)] +pub enum Identity { + Certificate, // { certificate: Arc<Certificate> }, +} - Ok("c2pa assert added".to_owned()) +/* +impl Identity { + #[uniffi::constructor] + pub fn new(certificate: Arc<Certificate>) -> Arc<Self> { + Arc::new(Identity::Certificate { certificate }) } } +*/ diff --git a/src/lib.rs b/src/lib.rs @@ -1,7 +1,16 @@ -mod content_credentials; -pub use content_credentials::ContentCredentials; +uniffi::setup_scaffolding!("simple_c2pa"); + +mod common; +pub use common::FileData; mod certificates; pub use certificates::{ - create_certificate, create_private_key, CertificateParams, CertificateType, + create_certificate, create_private_key, request_signed_certificate, CertificateOptions, + CertificateType, }; + +mod content_credentials; +pub use content_credentials::{ApplicationInfo, ContentCredentials, Identity}; + +mod assertions; +pub use assertions::{AIDataMiningUsage, CustomAITrainingOptions, ExifData}; diff --git a/tests/main.rs b/tests/main.rs @@ -0,0 +1,87 @@ +use simple_c2pa::{create_certificate, create_private_key, CertificateOptions, CertificateType}; +use simple_c2pa::{ApplicationInfo, ContentCredentials, ExifData, FileData}; +use std::env; +use std::fs; + +fn main() { + let args: Vec<String> = env::args().collect(); + + if args.len() != 2 { + eprintln!("Usage: command image.jpg data.json"); + std::process::exit(1); + } + + let image_path = &args[1]; + let file_name = image_path.split("/").last().unwrap().to_string(); + let file_data = fs::read(image_path).expect("Can't read image"); + let fingerprint = "BA08 71E8 0200 B95D 8297  7ED0 4D1E C37F 88A7 FDCE".to_string(); + + let root_key = create_private_key().unwrap(); + let root_options = CertificateOptions::new( + root_key.clone(), + CertificateType::OfflineRoot { + organization: None, + validity_days: None, + }, + None, + None, + None, + ); + let root_cert = create_certificate(root_options).unwrap(); + + let content_credentials_key = create_private_key().unwrap(); + let content_credentials_options = CertificateOptions::new( + content_credentials_key.clone(), + CertificateType::ContentCredentials { + organization: None, + validity_days: None, + }, + Some(root_cert.clone()), + None, + None, + ); + let content_credentials_certificate = create_certificate(content_credentials_options).unwrap(); + + let certificate = content_credentials_certificate.clone(); + let file = FileData::new(None, Some(file_data), Some(file_name.clone())); + let app_info = ApplicationInfo::new("SampleApp".to_string(), "1.0.0".to_string(), None); + let cc = ContentCredentials::new(certificate, file, Some(app_info)); + println!("{:?}", cc); + cc.add_created_assertion().unwrap(); + /* + let exif_data = ExifData::new(); + exif_data.gps_version_id = Some("2.2.0.0".to_string()); + exif_data.latitude = Some("39,21.102N".to_string()); + exif_data.longitude = Some("74,26.5737W".to_string()); + exif_data.altitude_ref = Some(0); + exif_data.altitude = Some("100963/29890".to_string()); + exif_data.timestamp = Some("2019-09-22T18:22:57Z".to_string()); + exif_data.speed_ref = Some("K".to_string()); + exif_data.speed = Some("4009/161323".to_string()); + exif_data.direction_ref = Some("T".to_string()); + exif_data.direction = Some("296140/911".to_string()); + exif_data.destination_bearing_ref = Some("T".to_string()); + exif_data.destination_bearing = Some("296140/911".to_string()); + exif_data.positioning_error = Some("13244/2207".to_string()); + exif_data.exposure_time = Some("1/100".to_string()); + exif_data.f_number = Some(4.0); + exif_data.color_space = Some(1); + exif_data.digital_zoom_ratio = Some(2.0); + exif_data.make = Some("ProofMode".to_string()); + exif_data.model = Some("ProofMode In-App Camera v2.0".to_string()); + exif_data.lens_make = Some("CameraCompany".to_string()); + exif_data.lens_model = Some("17.0-35.0 mm".to_string()); + exif_data.lens_specification = Some(vec![1.55, 4.2, 1.6, 2.4]); + + cc.add_exif_assertion(exif_data).unwrap(); + */ + cc.add_instagram_assertion("darrenjclarke".to_string(), "Darren Clarke".to_string()) + .unwrap(); + cc.add_pgp_assertion(fingerprint, "88A7FDCE".to_string()) + .unwrap(); + cc.add_website_assertion("https://redaranj.com".to_string()) + .unwrap(); + let output_path = format!("outputs/c2pa-{}", file_name); + let file_data = cc.embed_manifest(Some(output_path.clone())).unwrap(); + fs::write(output_path, file_data.get_bytes().unwrap()).expect("Can't write file"); +} diff --git a/uniffi.toml b/uniffi.toml @@ -0,0 +1,5 @@ +[bindings.swift] +module_name = "SimpleC2PA" + +[bindings.kotlin] +package_name = "info.guardianproject.simple_c2pa"