|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteu.emi.security.authn.x509.impl.SocketFactoryCreator
public class SocketFactoryCreator
Simple utility allowing programmers to quickly create SSL socket factories
using X509CertChainValidator
.
Constructor Summary | |
---|---|
SocketFactoryCreator()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SocketFactoryCreator()
Method Detail |
---|
public static X509TrustManager getSSLTrustManager(X509CertChainValidator v)
v
- validator to use for certificates validation
public 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 numbers
SSLContext
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 numbers
SSLServerSocketFactory
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.
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 numbers
SSLSocketFactory
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.
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 verified
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |