|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.net.SSLHelper
public class SSLHelper
simplifies dealing with untrusted certificates
| Constructor Summary | |
|---|---|
SSLHelper()
|
|
SSLHelper(Filter<String> hostnameFilter)
|
|
SSLHelper(Filter<String> hostnameFilter,
Filter<SSLSession> sessionFilter)
|
|
| Method Summary | |
|---|---|
void |
checkClientTrusted(X509Certificate[] chain,
String authType)
|
void |
checkServerTrusted(X509Certificate[] chain,
String authType)
|
X509Certificate[] |
getAcceptedIssuers()
|
Filter<String> |
getHostnameFilter()
|
KeyManagerFactory |
getKeyManagerFactory()
|
SecureRandom |
getRandom()
|
Filter<SSLSession> |
getSessionFilter()
|
SSLContext |
getSSLContext()
|
SSLServerSocketFactory |
getSSLServerSocketFactory()
|
SSLSocketFactory |
getSSLSocketFactory()
|
void |
handle(Object callbackSource,
URLConnection con)
configures itself to handle the encryption control aspects if the given connection is a secure one |
void |
setHostnameFilter(Filter<String> hostnameFilter)
|
void |
setKeyManagerFactory(KeyManagerFactory kmf)
resets the sslContext as a side-effect |
void |
setKeystore(File keystoreFile,
char[] password)
|
void |
setKeystore(InputStream keystoreStream,
char[] password)
|
static void |
setKeystoreFilePath(String keystoreFilePath)
|
static void |
setKeystorePassword(String password)
|
void |
setRandom(SecureRandom random)
resets the sslContext as a side-effect |
void |
setSessionFilter(Filter<SSLSession> sessionFilter)
|
static void |
setTrustStore(String trustStoreFilePath)
|
static void |
setTrustStorePassword(String password)
|
boolean |
verify(String hostname,
SSLSession session)
checks first the sessionFilter and then the hostnameFilter |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SSLHelper()
public SSLHelper(Filter<String> hostnameFilter)
public SSLHelper(Filter<String> hostnameFilter,
Filter<SSLSession> sessionFilter)
| Method Detail |
|---|
public Filter<String> getHostnameFilter()
public void setHostnameFilter(Filter<String> hostnameFilter)
public Filter<SSLSession> getSessionFilter()
public void setSessionFilter(Filter<SSLSession> sessionFilter)
public SecureRandom getRandom()
public void setRandom(SecureRandom random)
public KeyManagerFactory getKeyManagerFactory()
public void setKeyManagerFactory(KeyManagerFactory kmf)
public void setKeystore(File keystoreFile,
char[] password)
throws GeneralSecurityException,
IOException
GeneralSecurityException
IOException
public void setKeystore(InputStream keystoreStream,
char[] password)
throws GeneralSecurityException,
IOException
GeneralSecurityException
IOException
public void handle(Object callbackSource,
URLConnection con)
throws IOException
handle in interface Handler<URLConnection,IOException>callbackSource - the object that initiated this call-backcon - the item to be handled by this instance
IOException
public SSLContext getSSLContext()
throws KeyManagementException,
NoSuchAlgorithmException
KeyManagementException
NoSuchAlgorithmException
public SSLSocketFactory getSSLSocketFactory()
throws NoSuchAlgorithmException,
KeyManagementException
NoSuchAlgorithmException
KeyManagementException
public SSLServerSocketFactory getSSLServerSocketFactory()
throws NoSuchAlgorithmException,
KeyManagementException
NoSuchAlgorithmException
KeyManagementException
public boolean verify(String hostname,
SSLSession session)
verify in interface HostnameVerifier
public void checkClientTrusted(X509Certificate[] chain,
String authType)
throws CertificateException
checkClientTrusted in interface X509TrustManagerCertificateException
public void checkServerTrusted(X509Certificate[] chain,
String authType)
throws CertificateException
checkServerTrusted in interface X509TrustManagerCertificateExceptionpublic X509Certificate[] getAcceptedIssuers()
getAcceptedIssuers in interface X509TrustManagerpublic static void setKeystoreFilePath(String keystoreFilePath)
public static void setKeystorePassword(String password)
public static void setTrustStore(String trustStoreFilePath)
public static void setTrustStorePassword(String password)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||