Class SslContextHelper
java.lang.Object
com.github.jh3nd3rs0n.jargyle.internal.net.ssl.SslContextHelper
Helper class for
SSLContext
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic SSLContext
getSslContext
(String protocol, KeyManager[] keyManagers, TrustManager[] trustManagers) Returns aSSLContext
that implements the provided protocol and is initialized with the provided array ofKeyManager
s containing authentication keys and the provided array ofTrustManager
s containing peer authentication trust decisions.
-
Method Details
-
getSslContext
public static SSLContext getSslContext(String protocol, KeyManager[] keyManagers, TrustManager[] trustManagers) throws NoSuchAlgorithmException, KeyManagementException Returns aSSLContext
that implements the provided protocol and is initialized with the provided array ofKeyManager
s containing authentication keys and the provided array ofTrustManager
s containing peer authentication trust decisions.- Parameters:
protocol
- the provided protocolkeyManagers
- the provided array ofKeyManager
s containing authentication keys (can benull
)trustManagers
- the provided array ofTrustManager
s containing peer authentication trust decisions (can benull
)- Returns:
- a
SSLContext
that implements the provided protocol and is initialized with the provided array ofKeyManager
s containing authentication keys and the provided array ofTrustManager
s containing peer authentication trust decisions - Throws:
NoSuchAlgorithmException
- if the provided protocol is not supportedKeyManagementException
- if initialization of theSSLContext
fails.
-