class InstanceCertManager {

    public boolean updateSSHCertRecord(SSHCertRecord certRecord, boolean refresh) {

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

        if (certRecord == null) {
            return true;
        }

        boolean result = false;
        try (SSHRecordStoreConnection storeConnection = sshStore.getConnection()) {

            // if it's a refresh we're going to try to update first

            if (refresh && storeConnection.updateSSHCertRecord(certRecord)) {
                return true;
            }

            // if it's a register operation or if we get a failure, in the case
            // of refresh, then it's possible that we don't have the record so
            // we're going to create it

            result = storeConnection.insertSSHCertRecord(certRecord);
        } catch (Exception ex) {
            LOGGER.error("Unable to store ssh certificate record for principal {} - {}",
                    certRecord.getPrincipals(), ex.getMessage());
        }

        return result;
    }

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

}