| // Copyright 2026 Google LLC |
| // |
| // Licensed under the Apache License, Version 2.0 (the "License"); |
| // you may not use this file except in compliance with the License. |
| // You may obtain a copy of the License at |
| // |
| // https://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| // |
| |
| #ifndef THIRD_PARTY_CREDENTIO_VALIDATOR_VALIDATOR_OPTIONS_H_ |
| #define THIRD_PARTY_CREDENTIO_VALIDATOR_VALIDATOR_OPTIONS_H_ |
| |
| #include <cstdint> |
| #include <memory> |
| #include <string> |
| |
| #include "absl/base/nullability.h" |
| #include "absl/time/clock_interface.h" |
| #include "constants/spec_version.h" |
| #include "crypto/crypto_read_handler.h" |
| #include "validator/validator_metrics.h" |
| |
| namespace credentio { |
| |
| // Options controlling validator behavior. |
| struct ValidatorOptions { |
| // REQUIRED. Crypto read handler to use. |
| std::unique_ptr<CryptoReadHandler> absl_nonnull crypto_read_handler; |
| |
| // Clock to use (e.g., for certificate validity checks). |
| absl::Clock* clock = &absl::Clock::GetRealClock(); |
| |
| // Maximum size of chunks read from input files. |
| // |
| // If the C2PA metadata (manifest store) is larger than this limit, validation |
| // will fail. |
| int64_t max_chunk_bytes = 10 * 1024 * 1024; // 10 MiB |
| |
| // Enables the validator to process legacy manifests based on C2PA standards |
| // prior to version 2.1 (i.e. those with labels that do not begin with the |
| // prefix introduced in v2.1, `urn:c2pa`). This option bypasses the label |
| // check and the redaction of custom, deprecated, and gathered assertions; |
| // various pre-2.1 features are not supported. This option should only be used |
| // for testing. |
| // NOTE: This option is for testing only and cannot be used with |
| // CreateValidator. |
| bool accept_legacy_manifest_for_test = false; |
| |
| // Whether to collect metrics. |
| ValidatorMetrics* absl_nullable metrics = nullptr; |
| |
| // The C2PA specification version the product conforms to. |
| SpecVersion spec_version = SpecVersion::kUnspecified; |
| |
| // URI reference (including version/timestamp) to the trust list used. |
| std::string trust_list_uri; |
| }; |
| |
| } // namespace credentio |
| |
| #endif // THIRD_PARTY_CREDENTIO_VALIDATOR_VALIDATOR_OPTIONS_H_ |