package nl.htm.ovpay.abt;

import java.security.cert.X509Certificate;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

public final class DummyX509TrustManager implements X509TrustManager {

    private static DummyX509TrustManager INSTANCE;

    private DummyX509TrustManager() {
        // prevent instantiation
    }

    public static DummyX509TrustManager getInstance() {
        if (INSTANCE == null) {
            INSTANCE = new DummyX509TrustManager();
        }
        return INSTANCE;
    }

    public static TrustManager[] getDummyArray() {
        if (INSTANCE == null) {
            INSTANCE = new DummyX509TrustManager();
        }
        return new TrustManager[] { INSTANCE };
    }

    public X509Certificate[] getAcceptedIssuers() {
        return null;
    }

    public void checkClientTrusted(X509Certificate[] certs, String authType) {
    }

    public void checkServerTrusted(X509Certificate[] certs, String authType) {
    }
}
