public class SecureContextFactory extends Object
SSLContexts for TLS connections.
During construction, the factory attempts to create and initialize an
SSLContext for the given SecurityContext. Any exceptions
encountered along the way will be logged and captured. The state of the
factory can be examined with hasErrors(), and the captured
exceptions examined with getErrors(). Assuming all went well, the
SSLContext will be available via secureContext().
| Constructor and Description |
|---|
SecureContextFactory(SecurityContext context)
Creates a secure context factory that generates an
SSLContext
for the given security context. |
| Modifier and Type | Method and Description |
|---|---|
List<Exception> |
getErrors()
Returns the exceptions that were caught and logged during construction.
|
boolean |
hasErrors()
Returns
true if any exceptions were caught and logged during
construction. |
SSLContext |
secureContext()
Returns the SSL context.
|
String |
toString() |
public SecureContextFactory(SecurityContext context)
SSLContext
for the given security context.
Any exceptions encountered while attempting to create the
SSLContext will be logged and captured. A caller can discover
if there were any errors via hasErrors(), and can examine the
logged exceptions via getErrors().
context - the security contextpublic boolean hasErrors()
true if any exceptions were caught and logged during
construction.public List<Exception> getErrors()
public SSLContext secureContext()
Copyright © 2014. All Rights Reserved.