Package eu.emi.security.authn.x509.impl
Class SocketFactoryCreator2
- java.lang.Object
-
- eu.emi.security.authn.x509.impl.SocketFactoryCreator2
-
public class SocketFactoryCreator2 extends java.lang.Object
Utility allowing programmers to quickly create SSL socket factories using configuration abstractions of this library.
-
-
Constructor Summary
Constructors Constructor Description SocketFactoryCreator2(X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback)
SocketFactoryCreator2(X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback, java.security.SecureRandom rnd, java.lang.String protocol)
SocketFactoryCreator2(X509Credential credential, X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback)
SocketFactoryCreator2(X509Credential credential, X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback, java.security.SecureRandom rnd, java.lang.String protocol)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.net.ssl.SSLServerSocketFactory
getServerSocketFactory()
Returns anSSLServerSocketFactory
configured to check client certificates with a provided validator.javax.net.ssl.SSLSocketFactory
getSocketFactory()
Returns anSSLSocketFactory
configured to check servers' certificates with a provided validator.javax.net.ssl.SSLContext
getSSLContext()
Low level interface.javax.net.ssl.X509TrustManager
getSSLTrustManager()
Creates a SSL trustmanager which uses the provided validator.
-
-
-
Constructor Detail
-
SocketFactoryCreator2
public SocketFactoryCreator2(X509Credential credential, X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback, java.security.SecureRandom rnd, java.lang.String protocol)
-
SocketFactoryCreator2
public SocketFactoryCreator2(X509Credential credential, X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback)
-
SocketFactoryCreator2
public SocketFactoryCreator2(X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback, java.security.SecureRandom rnd, java.lang.String protocol)
-
SocketFactoryCreator2
public SocketFactoryCreator2(X509CertChainValidator validator, HostnameMismatchCallback2 hostnameMismatchCallback)
-
-
Method Detail
-
getSSLTrustManager
public javax.net.ssl.X509TrustManager getSSLTrustManager()
Creates a SSL trustmanager which uses the provided validator.- Returns:
- ready to use TrustManager
-
getSSLContext
public javax.net.ssl.SSLContext getSSLContext()
Low level interface. It can be used to getSSLContext
object initialized with the provided credential and validator.- Returns:
- initialized
SSLContext
object
-
getServerSocketFactory
public javax.net.ssl.SSLServerSocketFactory getServerSocketFactory()
Returns anSSLServerSocketFactory
configured to check client certificates with a provided validator. Server socket will use the provided credentials.- Returns:
- configured
SSLServerSocketFactory
-
getSocketFactory
public javax.net.ssl.SSLSocketFactory getSocketFactory()
Returns anSSLSocketFactory
configured to check servers' certificates with a provided validator. Client socket will use the provided credentials.- Returns:
- configured
SSLSocketFactory
-
-