|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mailster.crypto.X509SecureSocketFactory
public class X509SecureSocketFactory
---
Mailster (C) 2007-2009 De Oliveira Edouard
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 2 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, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
See Mailster
Web Site
---
X509SecureSocketFactory.java - A full featured SSL socket factory that uses X509v3 certificates.
| Nested Class Summary | |
|---|---|
static class |
X509SecureSocketFactory.SSLProtocol
|
| Field Summary | |
|---|---|
private static X509SecureSocketFactory |
_instance
|
private javax.net.ssl.SSLContext |
context
|
private javax.net.ssl.KeyManagerFactory |
kmf
|
private X509SecureSocketFactory.SSLProtocol |
selectedProtocol
|
private java.security.KeyStore |
temporaryTrustedKS
|
private javax.net.ssl.TrustManagerFactory |
tmf
|
private javax.net.ssl.X509TrustManager |
tmpTrustManager
Temporary trusted certificates are hold in this TrustManager. |
private UICertificateTrustCallBackHandler |
trustCallBackHandler
|
private java.security.KeyStore |
trustedKS
|
private javax.net.ssl.X509TrustManager |
trustManager
The default X509TrustManager provided by the JVM. |
| Constructor Summary | |
|---|---|
private |
X509SecureSocketFactory(java.lang.String protocol)
|
| Method Summary | |
|---|---|
void |
checkClientTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
|
void |
checkServerTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
|
void |
checkUserDecision(java.security.cert.X509Certificate[] chain,
java.lang.String authType,
boolean isServerCheck,
java.security.cert.CertificateException e)
|
java.security.cert.X509Certificate[] |
getAcceptedIssuers()
|
private java.lang.String |
getCertificateUniqueID(java.security.cert.X509Certificate x509)
|
javax.net.ssl.SSLContext |
getContext()
|
static X509SecureSocketFactory |
getInstance()
|
static X509SecureSocketFactory |
getInstance(X509SecureSocketFactory.SSLProtocol protocol,
UICertificateTrustCallBackHandler handler)
|
UICertificateTrustCallBackHandler |
getTrustCallBackHandler()
|
private javax.net.ssl.X509TrustManager |
initTrustManager(java.security.KeyStore ks)
|
static void |
reload()
|
void |
setTrustCallBackHandler(UICertificateTrustCallBackHandler trustCallBackHandler)
|
private javax.net.ssl.X509TrustManager |
updateAndCheckTrustManager(java.security.KeyStore ks,
java.security.cert.X509Certificate[] chain,
java.io.OutputStream out,
char[] pwd,
java.lang.String authType,
boolean isServerCheck)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private javax.net.ssl.TrustManagerFactory tmf
private javax.net.ssl.KeyManagerFactory kmf
private javax.net.ssl.SSLContext context
private java.security.KeyStore trustedKS
private java.security.KeyStore temporaryTrustedKS
private static X509SecureSocketFactory _instance
private X509SecureSocketFactory.SSLProtocol selectedProtocol
private UICertificateTrustCallBackHandler trustCallBackHandler
private javax.net.ssl.X509TrustManager trustManager
private javax.net.ssl.X509TrustManager tmpTrustManager
| Constructor Detail |
|---|
private X509SecureSocketFactory(java.lang.String protocol)
throws java.lang.Exception
java.lang.Exception| Method Detail |
|---|
public static X509SecureSocketFactory getInstance(X509SecureSocketFactory.SSLProtocol protocol,
UICertificateTrustCallBackHandler handler)
throws java.lang.Exception
java.lang.Exceptionpublic static X509SecureSocketFactory getInstance()
public static void reload()
throws java.lang.Exception
java.lang.Exception
private javax.net.ssl.X509TrustManager initTrustManager(java.security.KeyStore ks)
throws java.security.KeyStoreException
java.security.KeyStoreExceptionprivate java.lang.String getCertificateUniqueID(java.security.cert.X509Certificate x509)
private javax.net.ssl.X509TrustManager updateAndCheckTrustManager(java.security.KeyStore ks,
java.security.cert.X509Certificate[] chain,
java.io.OutputStream out,
char[] pwd,
java.lang.String authType,
boolean isServerCheck)
throws java.lang.Exception
java.lang.Exception
public void checkClientTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
throws java.security.cert.CertificateException
checkClientTrusted in interface javax.net.ssl.X509TrustManagerjava.security.cert.CertificateException
public void checkServerTrusted(java.security.cert.X509Certificate[] chain,
java.lang.String authType)
throws java.security.cert.CertificateException
checkServerTrusted in interface javax.net.ssl.X509TrustManagerjava.security.cert.CertificateException
public void checkUserDecision(java.security.cert.X509Certificate[] chain,
java.lang.String authType,
boolean isServerCheck,
java.security.cert.CertificateException e)
throws java.security.cert.CertificateException
java.security.cert.CertificateExceptionpublic java.security.cert.X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers in interface javax.net.ssl.X509TrustManagerpublic javax.net.ssl.SSLContext getContext()
public UICertificateTrustCallBackHandler getTrustCallBackHandler()
public void setTrustCallBackHandler(UICertificateTrustCallBackHandler trustCallBackHandler)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||