01: /*
02: * BEGIN_HEADER - DO NOT EDIT
03: *
04: * The contents of this file are subject to the terms
05: * of the Common Development and Distribution License
06: * (the "License"). You may not use this file except
07: * in compliance with the License.
08: *
09: * You can obtain a copy of the license at
10: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
11: * See the License for the specific language governing
12: * permissions and limitations under the License.
13: *
14: * When distributing Covered Code, include this CDDL
15: * HEADER in each file and include the License file at
16: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
17: * If applicable add the following below this CDDL HEADER,
18: * with the fields enclosed by brackets "[]" replaced with
19: * your own identifying information: Portions Copyright
20: * [year] [name of copyright owner]
21: */
22:
23: /*
24: * @(#)TlsContext.java
25: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
26: *
27: * END_HEADER - DO NOT EDIT
28: */
29: /**
30: * TlsContext.java
31: *
32: * SUN PROPRIETARY/CONFIDENTIAL.
33: * This software is the proprietary information of Sun Microsystems, Inc.
34: * Use is subject to license terms.
35: *
36: * Created on November 11, 2004, 8:46 PM
37: */package com.sun.jbi.internal.security.https;
38:
39: import com.sun.jbi.internal.security.KeyStoreManager;
40:
41: import javax.net.ssl.SSLContext;
42:
43: /**
44: *
45: * @author Sun Microsystems, Inc.
46: */
47: public class TlsContext {
48: /** The SSL Context. */
49: private SSLContext mSSLctx;
50:
51: /** Client Auth value. */
52: private boolean mClientAuthReq;
53:
54: /** KeyStore Manager. */
55: private KeyStoreManager mKSMgr;
56:
57: /**
58: * Creates a new instance of TlsContext.
59: *
60: * @param sslCtx is an initialized SSLContext
61: * @param isClientAuthReq is a boolean indicating whether Client Auth is required.
62: * @param ksMgr is the KeyStoreManager
63: */
64: public TlsContext(SSLContext sslCtx, boolean isClientAuthReq,
65: KeyStoreManager ksMgr) {
66: mSSLctx = sslCtx;
67: mClientAuthReq = isClientAuthReq;
68: mKSMgr = ksMgr;
69: }
70:
71: /**
72: * @return true if ClientAuth required
73: */
74: public boolean isClientAuthRequired() {
75: return mClientAuthReq;
76: }
77:
78: /**
79: * @return the SSLContext
80: */
81: public SSLContext getSSLContext() {
82: return mSSLctx;
83: }
84:
85: /**
86: * Get the KeyStoreManager associated with this Tls Context.
87: *
88: * @return the KeyStoreManager instance.
89: */
90: public KeyStoreManager getKeyStoreManager() {
91: return mKSMgr;
92: }
93:
94: }
|