class OpenSSHHostKeyVerifier extends PreferencesHostKeyVerifier {

    @Override
    public boolean verify(final Host host, final PublicKey key) throws ConnectionCanceledException, ChecksumException {
        if(null == database) {
            log.warn(String.format("Missing database %s", database));
            return super.verify(host, key);
        }
        final KeyType type = KeyType.fromKey(key);
        if(type == KeyType.UNKNOWN) {
            return false;
        }
        boolean foundApplicableHostEntry = false;
        for(OpenSSHKnownHosts.KnownHostEntry entry : database.entries()) {
            try {
                if(entry.appliesTo(type, format(host))) {
                    foundApplicableHostEntry = true;
                    if(entry.verify(key)) {
                        return true;
                    }
                }
            }
            catch(IOException e) {
                log.error(String.format("Failure verifying host key entry %s. %s", entry, e.getMessage()));
                return false;
            }
        }
        if(foundApplicableHostEntry) {
            try {
                return this.isChangedKeyAccepted(host, key);
            }
            catch(ConnectionCanceledException | ChecksumException e) {
                return false;
            }
        }
        try {
            return this.isUnknownKeyAccepted(host, key);
        }
        catch(ConnectionCanceledException | ChecksumException e) {
            return false;
        }
    }

    public  OpenSSHHostKeyVerifier(final Local file);

}