KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > security > ssl > iaik > SSLSetup


1 package org.jacorb.security.ssl.iaik;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1999-2004 Gerald Brose
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  *
22  */

23
24
25 /**
26  * SSL configuration for JacORB.
27  *
28  * Written 09.12.99 by André Benvenuti to support SSL
29  *
30  */

31
32 public class SSLSetup
33 {
34     // only strong cipher suites are accepted and rsa key exchange
35
private static final iaik.security.ssl.CipherSuite[] cs = {
36         iaik.security.ssl.CipherSuite.SSL_RSA_WITH_IDEA_CBC_SHA,
37         iaik.security.ssl.CipherSuite.SSL_RSA_WITH_3DES_EDE_CBC_SHA
38     };
39     protected static final int[][] cipher_suite_props = {
40         {iaik.security.ssl.CipherSuite.SSL_RSA_WITH_IDEA_CBC_SHA.getID(), 0x66},
41         {iaik.security.ssl.CipherSuite.SSL_RSA_WITH_3DES_EDE_CBC_SHA.getID(),0x66}};
42     protected static final byte[] types = {iaik.security.ssl.ClientTrustDecider.rsa_sign
43                                            // , iaik.security.ssl.ClientTrustDecider.dss_sign};
44
};
45
46     /**
47      * GB: added to avoid having to access the instance variable
48      */

49
50     public static iaik.security.ssl.CipherSuite[] getCipherSuites()
51     {
52         return cs;
53     }
54
55     public static boolean isSSL( java.net.Socket JavaDoc s )
56     {
57         return ( s instanceof iaik.security.ssl.SSLSocket );
58     }
59
60     public static String JavaDoc getMechanismType()
61     {
62         String JavaDoc sslMechType = "20,"
63                            + iaik.security.ssl.CipherSuite.SSL_RSA_WITH_IDEA_CBC_SHA.getID()
64                            + ","
65                            + iaik.security.ssl.CipherSuite.SSL_RSA_WITH_3DES_EDE_CBC_SHA.getID();
66         return sslMechType;
67     }
68
69 }
70
71
72
73
Popular Tags