/** * Copyright 2021 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 * * http://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. */ import { BundleEntry } from './BundleEntry'; /** * SignedFiles class creates a manifest file and a signature file according the the jar * specifications. Generating this class allows the manifest and signature files to be tightly * coupled reducing the amount of differences between the two files. */ export declare class SignedFiles { private bundleEntries; private readonly manifestVersionHeader; private readonly signatureVersionHeader; private readonly createdByHeader; /** * This generates a signed files class to hold all of the signed files info required for creating * a manifest and signature file. * * @param creator - The entity creating the files. * @param bundleEntries - An array of entries info from the zip file (a file location and a md5 * hash of the contents). */ constructor(creator: string, bundleEntries?: BundleEntry[]); /** * * @returns The manifest file as a string. */ getManifestString(): string; /** * * @returns The header of a manifest file (Version Header + Created By Header). */ getManifestMainAttributes(): string; /** * * @returns A sha256 digest of the manifest file. */ getManifestDigest(): Promise; /** * * @returns A sha256 digest of the main attributes (Version Header + Created by header) of the * manifest file */ getManifestMainAttributesDigest(): Promise; /** * * @param bundleEntry - Adds a bundle entry to the list of existing bundle entries. */ addBundleEntry(bundleEntry: BundleEntry): void; /** * * @returns The signature file as a string. */ getSignatureFileOutput(): Promise; }