KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lucane > applications > jmail > base > JMailTrustManager


1 package org.lucane.applications.jmail.base;
2
3 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
4  * This file is part of JMail *
5  * Copyright (C) 2002-2003 Yvan Norsa <norsay@wanadoo.fr> *
6  * *
7  * JMail is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * any later version. *
11  * *
12  * JMail is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have received a copy of the GNU General Public License along *
18  * with JMail; if not, write to the Free Software Foundation, Inc., *
19  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20  * *
21  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

22
23 import java.security.cert.*;
24 import javax.net.ssl.*;
25
26 /** This class is done thanks to Java Tip #115 ( http://www.javaworld.com/javatips/jw-javatip115.html ) */
27 public class JMailTrustManager implements X509TrustManager
28 {
29     public X509Certificate[] getAcceptedIssuers()
30     {
31     return(new X509Certificate[0]);
32     }
33
34     public void checkClientTrusted(X509Certificate[] cert, String JavaDoc a) throws CertificateException
35     {
36     checkServerTrusted(cert, a);
37     }
38
39     public void checkServerTrusted(X509Certificate[] cert, String JavaDoc a) throws CertificateException
40     {
41     }
42 }
43
Popular Tags