/** * 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 { DName } from './DName'; /** * This generates a x509 sigining certificate for code signing. It is the users responsibility to * protect this certificate from being lost or stolen as this can prevent future uploads to the App * Stores. See {@link https://chromeos.dev/en/publish/pwa-in-play#signing-key | this documentation} * for more info. The certificate generated has a lifespan of 25 years as recommended by the * Android documentation. * * @param dname - Distinguished Name * @param password - password to protect your key * @returns A promise of a base64 encoded pkcs12 der certificate. */ export declare function generateX509(dname: DName, password: string, alias?: string): Promise; /** * This signs the signature file using a certificate stored in a PKCS#12 keystore and returns a pem encoded * pkcs7 keystore of the signed file. More infomation can be found in these documents: * {@link https://github.com/digitalbazaar/forge#pkcs7|forge library documents} and * {@link https://docs.oracle.com/javase/7/docs/technotes/guides/jar/jar.html#:~:text=.RSA%20(PKCS7%20signature%2C%20SHA-256%20%2B%20RSA) | oracle jar signer spec} * @param signatureFile - contents of the signature file (a *.SF file) * @param keystoreContents - contents of the keystore that is der encoded read from disk. * @param password - The password to the keystore. * @param alias - The alias if the certificate within the keystore. * @returns */ export declare function SignString(signatureFile: string, keystoreContents: string, password: string, alias: string): string;