function installCertificateAuthority(options = {}) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        debug(`Uninstalling existing certificates, which will be void once any existing CA is gone`);
        uninstall();
        constants_1.ensureConfigDirs();
        debug(`Making a temp working directory for files to copied in`);
        let rootKeyPath = utils_1.mktmp();
        debug(`Generating the OpenSSL configuration needed to setup the certificate authority`);
        seedConfigFiles();
        debug(`Generating a private key`);
        certificates_1.generateKey(rootKeyPath);
        debug(`Generating a CA certificate`);
        utils_1.openssl(['req', '-new', '-x509', '-config', constants_1.caSelfSignConfig, '-key', rootKeyPath, '-out', constants_1.rootCACertPath, '-days', '825']);
        debug('Saving certificate authority credentials');
        yield saveCertificateAuthorityCredentials(rootKeyPath);
        debug(`Adding the root certificate authority to trust stores`);
        yield platforms_1.default.addToTrustStores(constants_1.rootCACertPath, options);
    });
}
/**
 * Install the once-per-machine trusted root CA. We'll use this CA to sign
 * per-app certs.
 */
Install the once-per-machine trusted root CA. We'll use this CA to sign
per-app certs.
Install the once - per - machine trusted root CA . We ' ll use this CA to sign per - app certs .
function installCertificateAuthority(options = {}) {
    return tslib_1.__awaiter(this, void 0, void 0, function* () {
        debug(`Uninstalling existing certificates, which will be void once any existing CA is gone`);
        uninstall();
        constants_1.ensureConfigDirs();
        debug(`Making a temp working directory for files to copied in`);
        let rootKeyPath = utils_1.mktmp();
        debug(`Generating the OpenSSL configuration needed to setup the certificate authority`);
        seedConfigFiles();
        debug(`Generating a private key`);
        certificates_1.generateKey(rootKeyPath);
        debug(`Generating a CA certificate`);
        utils_1.openssl(['req', '-new', '-x509', '-config', constants_1.caSelfSignConfig, '-key', rootKeyPath, '-out', constants_1.rootCACertPath, '-days', '825']);
        debug('Saving certificate authority credentials');
        yield saveCertificateAuthorityCredentials(rootKeyPath);
        debug(`Adding the root certificate authority to trust stores`);
        yield platforms_1.default.addToTrustStores(constants_1.rootCACertPath, options);
    });
}
function installCertificateAuthority ( options = { } ) { return tslib_1 . __awaiter ( this , void 0 , void 0 , function * ( ) { debug ( ` ` ) ; uninstall ( ) ; constants_1 . ensureConfigDirs ( ) ; debug ( ` ` ) ; let rootKeyPath = utils_1 . mktmp ( ) ; debug ( ` ` ) ; seedConfigFiles ( ) ; debug ( ` ` ) ; certificates_1 . generateKey ( rootKeyPath ) ; debug ( ` ` ) ; utils_1 . openssl ( [ 'req' , '-new' , '-x509' , '-config' , constants_1 . caSelfSignConfig , '-key' , rootKeyPath , '-out' , constants_1 . rootCACertPath , '-days' , '825' ] ) ; debug ( 'Saving certificate authority credentials' ) ; yield saveCertificateAuthorityCredentials ( rootKeyPath ) ; debug ( ` ` ) ; yield platforms_1 . default . addToTrustStores ( constants_1 . rootCACertPath , options ) ; } ) ; }
Install the once-per-machine trusted root CA.
Install the once - per - machine trusted root CA .