blob: 47531a9411574bbf7e5a847795dd39e70cc2f148 [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/asset_type.proto";
// `CollectionDataHashAssertion` contains an array of URIs and their associated
// hashes. Based on `collection-data-hash-map`:
// https://spec.c2pa.org/specifications/specifications/2.4/specs/C2PA_Specification.html#_collection_data_hash.
message CollectionDataHashAssertion {
repeated UriHashedData uris = 1 [(cbor.tags) = { is_required: true }];
// A string identifying the cryptographic hash algorithm used to compute the
// hash on each entry of the `uris` array, taken from the C2PA hash algorithm
// identifier list.
string alg = 2 [(cbor.tags) = { is_required: true }];
// The hash of the ZIP central directory in ZIP-based assets.
bytes zip_central_directory_hash = 3;
}
// `UriHashedData` is used to store a reference to a URI and its hash. Based on
// `uri-hashed-data-map`:
// https://spec.c2pa.org/specifications/specifications/2.4/specs/C2PA_Specification.html#_collection_data_hash.
message UriHashedData {
// Relative URI reference.
string uri = 1 [(cbor.tags) = { is_required: true }];
// Byte string containing the hash value.
bytes hash = 2 [(cbor.tags) = { is_required: true }];
// Number of bytes of data.
int64 size = 3;
// IANA media type of the data.
string type = 4 [(cbor.tags) = { name: "dc:format" }];
// Additional information about the data's type.
repeated AssetType data_types = 5;
}