class InstanceCertManager {

    private boolean loadCertificateAuthorityBundles() {

        // check to see if we have been provided with a x.509/ssh certificate
        // bundle or we need to fetch one from the certsigner

        responseSendSSHSignerCerts = Boolean.parseBoolean(
                System.getProperty(ZTSConsts.ZTS_PROP_RESP_SSH_SIGNER_CERTS, "true"));
        responseSendX509SignerCerts = Boolean.parseBoolean(
                System.getProperty(ZTSConsts.ZTS_PROP_RESP_X509_SIGNER_CERTS, "true"));

        // if we're not asked to skip sending certificate signers then
        // check to see if we need to load them from files instead of
        // certsigner directly

        if (responseSendX509SignerCerts) {
            caX509CertificateSigner = loadCertificateBundle(ZTSConsts.ZTS_PROP_X509_CA_CERT_FNAME);
        }
        if (responseSendSSHSignerCerts) {
            sshUserCertificateSigner = loadCertificateBundle(ZTSConsts.ZTS_PROP_SSH_USER_CA_CERT_FNAME);
            sshHostCertificateSigner = loadCertificateBundle(ZTSConsts.ZTS_PROP_SSH_HOST_CA_CERT_FNAME);
        }

        // now let's fetch our configured certificate authority bundles

        certAuthorityBundles = new HashMap<>();

        final String caBundleFile =  System.getProperty(ZTSConsts.ZTS_PROP_CERT_BUNDLES_FNAME);
        if (caBundleFile == null || caBundleFile.isEmpty()) {
            return true;
        }

        byte[] data = readFileContents(caBundleFile);
        if (data == null) {
            return false;
        }

        CertBundles certBundles = null;
        try {
            certBundles = jsonMapper.readValue(data, CertBundles.class);
        } catch (Exception ex) {
            LOGGER.error("Unable to parse CA bundle file: {} - {}", caBundleFile, ex.getMessage());
        }

        if (certBundles == null) {
            return false;
        }

        List<CertBundle> bundleList = certBundles.getCertBundles();
        if (bundleList == null || bundleList.isEmpty()) {
            LOGGER.error("No CA bundles available in the file: {}", caBundleFile);
            return false;
        }

        for (CertBundle bundle : bundleList) {
            if (!processCertificateAuthorityBundle(bundle)) {
                return false;
            }
        }

        return true;
    }

    public  InstanceCertManager(final PrivateKeyStore keyStore, Authorizer authorizer, HostnameResolver hostnameResolver,
            boolean readOnlyMode);

}