001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: /**
019: * @author Alexander Y. Kleymenov
020: * @version $Revision$
021: */package org.apache.harmony.xnet.provider.jsse;
022:
023: import java.security.AccessController;
024: import java.security.Provider;
025:
026: /**
027: * JSSE Provider implementation.
028: *
029: * This implementation is based on TLS v 1.0 and SSL v3 protocol specifications.
030: *
031: * @see TLS v 1.0 Protocol specification (http://www.ietf.org/rfc/rfc2246.txt)
032: * @see SSL v3 Protocol specification (http://wp.netscape.com/eng/ssl3)
033: *
034: * Provider implementation supports the following cipher suites:
035: * TLS_NULL_WITH_NULL_NULL
036: * TLS_RSA_WITH_NULL_MD5
037: * TLS_RSA_WITH_NULL_SHA
038: * TLS_RSA_EXPORT_WITH_RC4_40_MD5
039: * TLS_RSA_WITH_RC4_128_MD5
040: * TLS_RSA_WITH_RC4_128_SHA
041: * TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5
042: * TLS_RSA_WITH_IDEA_CBC_SHA
043: * TLS_RSA_EXPORT_WITH_DES40_CBC_SHA
044: * TLS_RSA_WITH_DES_CBC_SHA
045: * TLS_RSA_WITH_3DES_EDE_CBC_SHA
046: * TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA
047: * TLS_DH_DSS_WITH_DES_CBC_SHA
048: * TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA
049: * TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA
050: * TLS_DH_RSA_WITH_DES_CBC_SHA
051: * TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA
052: * TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA
053: * TLS_DHE_DSS_WITH_DES_CBC_SHA
054: * TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA
055: * TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA
056: * TLS_DHE_RSA_WITH_DES_CBC_SHA
057: * TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA
058: * TLS_DH_anon_EXPORT_WITH_RC4_40_MD5
059: * TLS_DH_anon_WITH_RC4_128_MD5
060: * TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA
061: * TLS_DH_anon_WITH_DES_CBC_SHA
062: * TLS_DH_anon_WITH_3DES_EDE_CBC_SHA
063: *
064: * The real set of available cipher suites depends on set of available
065: * crypto algorithms. These algorithms must be provided by some crypto
066: * provider.
067: *
068: * The following cipher algorithms are used by different cipher suites:
069: * IDEA/CBC/NoPadding
070: * RC2/CBC/NoPadding
071: * RC4
072: * DES/CBC/NoPadding
073: * DES/CBC/NoPadding
074: * DESede/CBC/NoPadding
075: *
076: * Also the current JSSE provider implementation uses the following
077: * crypto algorithms:
078: *
079: * Algorithms that MUST be provided by crypto provider:
080: * Mac HmacMD5
081: * Mac HmacSHA1
082: * MessageDigest MD5
083: * MessageDigest SHA-1
084: * CertificateFactory X509
085: *
086: * The cipher suites with RSA key exchange may also require:
087: * Cipher RSA
088: * KeyPairGenerator RSA
089: * KeyFactory RSA
090: *
091: * The cipher suites with DH key exchange may also require:
092: * Signature NONEwithDSA
093: * KeyPairGenerator DiffieHellman or DH
094: * KeyFactory DiffieHellman or DH
095: * KeyAgreement DiffieHellman or DH
096: * KeyPairGenerator DiffieHellman or DH
097: *
098: * Trust manager implementation requires:
099: * CertPathValidator PKIX
100: * CertificateFactory X509
101: *
102: */
103: public final class JSSEProvider extends Provider {
104:
105: public JSSEProvider() {
106: super ("HarmonyJSSE", 1.0, "Harmony JSSE Provider");
107: AccessController
108: .doPrivileged(new java.security.PrivilegedAction<Void>() {
109: public Void run() {
110: put("SSLContext.TLS",
111: "org.apache.harmony.xnet.provider.jsse.SSLContextImpl");
112: put("Alg.Alias.SSLContext.TLSv1", "TLS");
113: put("KeyManagerFactory.X509",
114: "org.apache.harmony.xnet.provider.jsse.KeyManagerFactoryImpl");
115: put("TrustManagerFactory.X509",
116: "org.apache.harmony.xnet.provider.jsse.TrustManagerFactoryImpl");
117: return null;
118: }
119: });
120: }
121: }
|