All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bouncycastle.jsse.provider.DummyX509TrustManager Maven / Gradle / Ivy

Go to download

The Bouncy Castle Java APIs for the TLS, including a JSSE provider. The APIs are designed primarily to be used in conjunction with the BC FIPS provider. The APIs may also be used with other providers although if being used in a FIPS context it is the responsibility of the user to ensure that any other providers used are FIPS certified and used appropriately.

There is a newer version: 2.0.19
Show newest version
package org.bouncycastle.jsse.provider;

import java.net.Socket;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;

import javax.net.ssl.SSLEngine;

import org.bouncycastle.jsse.BCX509ExtendedTrustManager;

final class DummyX509TrustManager
    extends BCX509ExtendedTrustManager
{
    static final BCX509ExtendedTrustManager INSTANCE = new DummyX509TrustManager();

    private DummyX509TrustManager()
    {
    }

    public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException
    {
        throw new CertificateException("No X509TrustManager implementation available");
    }

    @Override
    public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException
    {
        throw new CertificateException("No X509TrustManager implementation available");
    }

    @Override
    public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine)
        throws CertificateException
    {
        throw new CertificateException("No X509TrustManager implementation available");
    }

    public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException
    {
        throw new CertificateException("No X509TrustManager implementation available");
    }

    @Override
    public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException
    {
        throw new CertificateException("No X509TrustManager implementation available");
    }

    @Override
    public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine)
        throws CertificateException
    {
        throw new CertificateException("No X509TrustManager implementation available");
    }

    public X509Certificate[] getAcceptedIssuers()
    {
        return new X509Certificate[0];
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy