| // 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_FORMATS_ZIP_CONSTANTS_H_ |
| #define THIRD_PARTY_CREDENTIO_FORMATS_ZIP_CONSTANTS_H_ |
| |
| #include "absl/strings/string_view.h" |
| |
| namespace credentio { |
| |
| constexpr absl::string_view kZipCentralDirectorySignature = "PK\x01\x02"; |
| constexpr absl::string_view kZipLocalFileHeaderSignature = "PK\x03\x04"; |
| constexpr absl::string_view kZipEndOfCentralDirectorySignature = "PK\x05\x06"; |
| constexpr absl::string_view kZipZip64EndOfCentralDirectorySignature = |
| "PK\x06\x07"; |
| constexpr absl::string_view kZipDataDescriptorSignature = "PK\x07\x08"; |
| |
| // Size of the data descriptor, with or without the optional signature. |
| constexpr int kDataDescriptorWithSignatureSize = 16; |
| constexpr int kDataDescriptorSize = 12; |
| // Size of the fixed portion of the local file header, excluding the file name |
| // and extra fields. |
| constexpr int kLocalFileHeaderFixedSize = 30; |
| // Size of the fixed portion of the central directory header, excluding the file |
| // name, extra field and file comment. |
| constexpr int kCentralDirectoryHeaderFixedSize = 46; |
| // Size of the End of Central Directory (EOCD) record. |
| // ZIP files based on ISO/IEC 29500:2 (OOXML) do not allow a comment field in |
| // the EOCD record, making it a fixed size. |
| constexpr int kEocdRecordSize = 22; |
| |
| constexpr absl::string_view kZipManifestFileName = |
| "META-INF/content_credential.c2pa"; |
| constexpr absl::string_view kZipC2paManifestMimeType = "application/c2pa"; |
| constexpr absl::string_view kOoxmlContentTypesFileName = "[Content_Types].xml"; |
| } // namespace credentio |
| |
| #endif // THIRD_PARTY_CREDENTIO_FORMATS_ZIP_CONSTANTS_H_ |