public class SocketFactoryCreator extends Object
X509CertChainValidator
.Constructor and Description |
---|
SocketFactoryCreator() |
public static X509TrustManager getSSLTrustManager(X509CertChainValidator v)
v
- validator to use for certificates validationpublic static SSLContext getSSLContext(X509Credential c, X509CertChainValidator v, SecureRandom r)
SSLContext
object initialized with the
provided credential and validator.c
- credential to use for the created sockets. If null, then anonymous socket will be created,
what is useful only for client side.v
- validator to use for certificates validationr
- implementation providing random numbersSSLContext
objectpublic static SSLServerSocketFactory getServerSocketFactory(X509Credential c, X509CertChainValidator v, SecureRandom r)
SSLServerSocketFactory
configured to check
client certificates with a provided validator. Server socket will use
the provided credentials.c
- credential to use for the server socketv
- validator to use for client's validationr
- implementation providing random numbersSSLServerSocketFactory
public static SSLServerSocketFactory getServerSocketFactory(X509Credential c, X509CertChainValidator v)
getServerSocketFactory(X509Credential, X509CertChainValidator, SecureRandom)
using SecureRandom
implementation as the last argument. Note that this
method might block if the machine has not enough system entropy. It is not suggested to use
this method for setting up automatic test environments, however it is suitable for production setups.c
- credential to use for the server socketv
- validator to use for client's validationSSLServerSocketFactory
public static SSLSocketFactory getSocketFactory(X509Credential c, X509CertChainValidator v, SecureRandom r)
SSLSocketFactory
configured to check
servers' certificates with a provided validator. Client socket will use
the provided credentials.c
- credential to use for the client socketv
- validator to use for server's validationr
- implementation providing random numbersSSLSocketFactory
public static SSLSocketFactory getSocketFactory(X509Credential c, X509CertChainValidator v)
getSocketFactory(X509Credential, X509CertChainValidator, SecureRandom)
using SecureRandom
implementation as the last argument. Note that this
method might block if the machine has not enough system entropy. It is not suggested to use
this method for setting up automatic test environments, however it is suitable for production setups.c
- credential to use for the client socketv
- validator to use for server's validationSSLSocketFactory
public static void connectWithHostnameChecking(SSLSocket socket, HostnameMismatchCallback callback) throws SSLPeerUnverifiedException
socket
- socket to be checkedcallback
- used when there is mismatch.SSLPeerUnverifiedException
- if the peer was not verifiedCopyright © 2012-2017 European Middleware Initiative. All Rights Reserved.