/*
 * Copyright (c) Markus Duft <markus.duft@salomon.at>
 * I put this file in the public domain. Do with it what you like, but don't blame me afterwards :)
 */
package com.wamas.ide.git;

import com.jcraft.jsch.HostKey;
import com.jcraft.jsch.HostKeyRepository;
import com.jcraft.jsch.UserInfo;

/**
 * Repository that accepts any host key without checks
 */
public class AnyHostKeyRepository implements HostKeyRepository {

    private static final HostKey[] EMPTY_KEYS = new HostKey[0];

    @Override
    public int check(String host, byte[] key) {
        return HostKeyRepository.OK;
    }

    @Override
    public void add(HostKey hostkey, UserInfo ui) {

    }

    @Override
    public void remove(String host, String type) {
    }

    @Override
    public void remove(String host, String type, byte[] key) {
    }

    @Override
    public String getKnownHostsRepositoryID() {
        return "";
    }

    @Override
    public HostKey[] getHostKey() {
        return EMPTY_KEYS;
    }

    @Override
    public HostKey[] getHostKey(String host, String type) {
        return EMPTY_KEYS;
    }

}
