Logo Search packages:      
Sourcecode: fex version File versions  Download package

NaiveTrustManager.java

package fix;

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

import javax.net.ssl.X509TrustManager;

/**
 * This Trust Manager is "naive" because it trusts everyone. 
 * 
 * $Date: 2010-02-04 12:01:01 +0100 (Thu, 04 Feb 2010) $
 * $Revision: 30 $
 * $Author: roth $
 * 
 * Copyright (C) 2008 Dominik Greibl
 * Copyright (C) 2009 Sebastian Roth
 * 
 * All Rights Reserved
 * 
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

00034 public class NaiveTrustManager implements X509TrustManager {
      /**
       * Doesn't throw an exception, so this is how it approves a certificate.
       * @see javax.net.ssl.X509TrustManager#checkClientTrusted(java.security.cert.X509Certificate[], String)
       **/
00039       public void checkClientTrusted(X509Certificate[] cert, String authType)
                  throws CertificateException {
      }

      /**
       * Doesn't throw an exception, so this is how it approves a certificate.
       * @see javax.net.ssl.X509TrustManager#checkServerTrusted(java.security.cert.X509Certificate[], String)
       **/
00047       public void checkServerTrusted(X509Certificate[] cert, String authType)
                  throws CertificateException {
      }

      /**
       * @see javax.net.ssl.X509TrustManager#getAcceptedIssuers()
       **/
00054       public X509Certificate[] getAcceptedIssuers() {
            return null;
      }
}

Generated by  Doxygen 1.6.0   Back to index