blob: b18b22dc94c4cda16ce1d21cf58feafdf3b11866 [file]
// 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.
//
edition = "2024";
package credentio;
import "cbor/tags.proto";
import "proto/hashed_uri.proto";
// Based on `multi-asset-hash-map`:
// https://spec.c2pa.org/specifications/specifications/2.4/specs/C2PA_Specification.html#_general_box_hash.
message MultiAssetHashAssertion {
repeated MultiAssetPart parts = 1
[(cbor.tags) = { is_required: true, disallow_empty: true }];
// For internal use in the manifest generator -- do not set or read.
bytes pad = 2 [(cbor.tags) = { is_required: true }];
// For internal use in the manifest generator -- do not set or read.
bytes pad2 = 3;
}
// Based on `locator-map`:
// https://spec.c2pa.org/specifications/specifications/2.4/specs/C2PA_Specification.html#_schema_and_example_6.
// Either the `byte_offset` and `length` of a byte range or the `bmff_box` of a
// BMFF box.
message MultiAssetPartLocation {
// These two fields are used to specify a window of bytes within a file.
int64 byte_offset = 1 [(cbor.tags) = { name: "byteOffset", type: TYPE_UINT }];
int64 length = 2 [(cbor.tags) = { type: TYPE_UINT }];
// This field is used to specify a BMFF box.
string bmff_box = 3 [(cbor.tags) = { name: "bmffBox" }];
}
message MultiAssetPart {
// The location of the hash part.
MultiAssetPartLocation location = 1;
// The hash of the part.
HashedUri hash_assertion = 2 [(cbor.tags) = { name: "hashAssertion" }];
// Whether the hash is optional.
bool is_optional = 3 [(cbor.tags) = { name: "optional" }];
}