| // 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_CONSTANTS_LABELS_H_ |
| #define THIRD_PARTY_CREDENTIO_CONSTANTS_LABELS_H_ |
| |
| #include <cstdint> |
| |
| #include "absl/strings/string_view.h" |
| #include "jumbf/constants.h" |
| #include "uuid/uuid.h" |
| |
| namespace credentio { |
| |
| // Delimiter used to separate the various components of a manifest label. |
| inline constexpr absl::string_view kManifestLabelDelimiter = "/"; |
| |
| // Minimum Jumbf description toggles required to support C2PA. See |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_labels_2. |
| inline constexpr uint8_t kMinimumJumbfDescriptionToggles = |
| jumbf::kDescriptionToggleLabelPresent | |
| jumbf::kDescriptionToggleRequestable; |
| |
| // Box label and UUID of the C2PA Manifest Store box. See |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_manifest_store. |
| inline constexpr absl::string_view kManifestStoreLabel = "c2pa"; |
| inline constexpr absl::string_view kManifestStoreUrlPrefix = |
| "self#jumbf=/c2pa/"; |
| inline constexpr Uuid kManifestStoreUuid( |
| Uuid::FromStringOrDie("63327061-0011-0010-8000-00AA00389B71")); |
| |
| // Box UUIDs of the C2PA Manifest box. See |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_manifest_store |
| inline constexpr Uuid kStandardManifestUuid( |
| Uuid::FromStringOrDie("63326D61-0011-0010-8000-00AA00389B71")); |
| inline constexpr Uuid kCompressedManifestUuid( |
| Uuid::FromStringOrDie("6332636D-0011-0010-8000-00AA00389B71")); |
| inline constexpr Uuid kUpdateManifestUuid( |
| Uuid::FromStringOrDie("6332756D-0011-0010-8000-00AA00389B71")); |
| inline constexpr Uuid kTimestampManifestUuid( |
| Uuid::FromStringOrDie("6332746D-0011-0010-8000-00AA00389B71")); |
| |
| // Box labels and UUID of the C2PA Claim box. |
| // The deprecated (v1) format shares the same UUID as the current (v2) format. |
| // See |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_claim_and_claim_signature. |
| inline constexpr absl::string_view kClaimV1Label = "c2pa.claim"; |
| inline constexpr absl::string_view kClaimV2Label = "c2pa.claim.v2"; |
| inline constexpr Uuid kClaimUuid( |
| Uuid::FromStringOrDie("6332636C-0011-0010-8000-00AA00389B71")); |
| |
| // Box label and UUID of the C2PA Claim Signature box. |
| // See |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_claim_and_claim_signature. |
| inline constexpr absl::string_view kClaimSignatureLabel = "c2pa.signature"; |
| inline constexpr absl::string_view kClaimSignatureUrl = |
| "self#jumbf=c2pa.signature"; |
| inline constexpr Uuid kClaimSignatureUuid( |
| Uuid::FromStringOrDie("63326373-0011-0010-8000-00AA00389B71")); |
| |
| // Box label and UUID of the C2PA Assertion Store box. See |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_assertion_store_2. |
| inline constexpr absl::string_view kAssertionStoreLabel = "c2pa.assertions"; |
| inline constexpr absl::string_view kAssertionStoreUrlPrefix = |
| "self#jumbf=c2pa.assertions/"; |
| inline constexpr Uuid kAssertionStoreUuid( |
| Uuid::FromStringOrDie("63326173-0011-0010-8000-00AA00389B71")); |
| |
| // C2PA assertion labels. |
| inline constexpr absl::string_view kActionsAssertionV2Label = "c2pa.actions.v2"; |
| inline constexpr absl::string_view kActionsAssertionV1Label = "c2pa.actions"; |
| inline constexpr absl::string_view kBmffBasedHashAssertionV2Label = |
| "c2pa.hash.bmff.v2"; |
| inline constexpr absl::string_view kBmffBasedHashAssertionV3Label = |
| "c2pa.hash.bmff.v3"; |
| inline constexpr absl::string_view kDataHashAssertionLabel = "c2pa.hash.data"; |
| inline constexpr absl::string_view kBoxesHashAssertionLabel = "c2pa.hash.boxes"; |
| inline constexpr absl::string_view kCollectionDataHashAssertionLabel = |
| "c2pa.hash.collection.data"; |
| inline constexpr absl::string_view kBmffBasedHashAssertionV2PartLabel = |
| "c2pa.hash.bmff.v2.part"; |
| inline constexpr absl::string_view kBmffBasedHashAssertionV3PartLabel = |
| "c2pa.hash.bmff.v3.part"; |
| inline constexpr absl::string_view kDataHashAssertionPartLabel = |
| "c2pa.hash.data.part"; |
| inline constexpr absl::string_view kBoxesHashAssertionPartLabel = |
| "c2pa.hash.boxes.part"; |
| inline constexpr absl::string_view kCollectionDataHashAssertionPartLabel = |
| "c2pa.hash.collection.data.part"; |
| inline constexpr absl::string_view kMultiAssetHashAssertionLabel = |
| "c2pa.hash.multi-asset"; |
| inline constexpr absl::string_view kIngredientAssertionV1Label = |
| "c2pa.ingredient"; |
| inline constexpr absl::string_view kIngredientAssertionV2Label = |
| "c2pa.ingredient.v2"; |
| inline constexpr absl::string_view kIngredientAssertionV3Label = |
| "c2pa.ingredient.v3"; |
| inline constexpr absl::string_view kGDepthAssertionLabel = |
| "c2pa.depthmap.GDepth"; |
| inline constexpr absl::string_view kAiDisclosureAssertionLabel = |
| "c2pa.ai-disclosure"; |
| inline constexpr absl::string_view kEnvironmentalSustainabilityAssertionLabel = |
| "c2pa.environmental-sustainability"; |
| inline constexpr absl::string_view kSoftBindingAssertionLabel = |
| "c2pa.soft-binding"; |
| inline constexpr absl::string_view kRepositoryReceiptAssertionLabel = |
| "c2pa.repository-receipt"; |
| inline constexpr absl::string_view kThumbnailClaimAssertionLabelPrefix = |
| "c2pa.thumbnail.claim."; |
| inline constexpr absl::string_view kThumbnailIngredientAssertionLabelPrefix = |
| "c2pa.thumbnail.ingredient."; |
| inline constexpr absl::string_view kMetadataAssertionLabelSuffix = ".metadata"; |
| |
| // The UUID of the C2PA BMFF box is D8FEC3D6-1B0E-483C-9297-5828877EC481. |
| // See |
| // https://spec.c2pa.org/specifications/specifications/2.2/specs/C2PA_Specification.html#_definition. |
| inline constexpr absl::string_view kC2paBmffBoxUuid( |
| "\xD8\xFE\xC3\xD6\x1B\x0E\x48\x3C\x92\x97\x58\x28\x87\x7E\xC4\x81", 16); |
| |
| } // namespace credentio |
| |
| #endif // THIRD_PARTY_CREDENTIO_CONSTANTS_LABELS_H_ |