javax.net.ssl.SSLContext instances.Note
the default Oracle JSSE implementation of SSLContext#init(KeyManager[], TrustManager[], SecureRandom)
accepts multiple key and trust managers, however only only first matching type is ever used.
See for example:
SSLContext.html#init
TODO Specify which Oracle JSSE versions the above has been verified.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private String | |
| private final Set | |
| private String | |
| private String | |
| private Provider | |
| private SecureRandom | |
| pack-priv static final String | |
| private String | |
| private final Set |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public SSLContext | |
| public static SSLContextBuilder | |
| protected void | initSSLContext(final SSLContext sslContext, final Collection<KeyManager> keyManagers, final Collection<TrustManager> trustManagers, final SecureRandom secureRandom)
|
| public SSLContextBuilder | loadKeyMaterial(final KeyStore keystore, final char[] keyPassword, final PrivateKeyStrategy aliasStrategy)
|
| public SSLContextBuilder | |
| public SSLContextBuilder | loadKeyMaterial(final File file, final char[] storePassword, final char[] keyPassword, final PrivateKeyStrategy aliasStrategy)
|
| public SSLContextBuilder | |
| public SSLContextBuilder | loadKeyMaterial(final URL url, final char[] storePassword, final char[] keyPassword, final PrivateKeyStrategy aliasStrategy)
|
| public SSLContextBuilder | |
| public SSLContextBuilder | |
| public SSLContextBuilder | |
| public SSLContextBuilder | |
| public SSLContextBuilder | |
| public SSLContextBuilder | |
| public SSLContextBuilder | |
| public SSLContextBuilder | |
| public SSLContextBuilder | Returns: this builderthe key manager factory algorithm name of the requested protocol. See
the KeyManagerFactory section in the Java
Cryptography Architecture Standard Algorithm Name
Documentation for more information. keyManagerFactoryAlgorithm)Sets the key manager factory algorithm name. |
| public SSLContextBuilder | Returns: this builderthe SSLkey store type. See
the KeyStore section in the Java
Cryptography Architecture Standard Algorithm Name
Documentation for more information. keyStoreType)Sets the key store type. |
| public SSLContextBuilder | Returns: this builderthe SSLContext protocol algorithm name of the requested protocol. See
the SSLContext section in the Java
Cryptography Architecture Standard Algorithm Name
Documentation for more information. protocol)Sets the SSLContext protocol algorithm name. |
| public SSLContextBuilder | |
| public SSLContextBuilder | |
| public SSLContextBuilder | |
| public SSLContextBuilder | Returns: this builderthe trust manager algorithm name of the requested protocol. See
the TrustManagerFactory section in the Java
Cryptography Architecture Standard Algorithm Name
Documentation for more information. trustManagerFactoryAlgorithm)Sets the trust manager factory algorithm name. |
| public String | |
| public SSLContextBuilder | Returns: this builderthe SSLContext protocol algorithm name of the requested protocol. See
the SSLContext section in the Java
Cryptography Architecture Standard Algorithm Name
Documentation for more information. protocol)
Deprecated
Use
Sets the SSLContext protocol algorithm name.
setProtocol(String).
|
| keyManagerFactoryAlgorithm | back to summary |
|---|---|
| private String keyManagerFactoryAlgorithm | |
| keyManagers | back to summary |
|---|---|
| private final Set<KeyManager> keyManagers | |
| keyStoreType | back to summary |
|---|---|
| private String keyStoreType | |
| protocol | back to summary |
|---|---|
| private String protocol | |
| provider | back to summary |
|---|---|
| private Provider provider | |
| secureRandom | back to summary |
|---|---|
| private SecureRandom secureRandom | |
| TLS | back to summary |
|---|---|
| pack-priv static final String TLS | |
| trustManagerFactoryAlgorithm | back to summary |
|---|---|
| private String trustManagerFactoryAlgorithm | |
| trustManagers | back to summary |
|---|---|
| private final Set<TrustManager> trustManagers | |
| SSLContextBuilder | back to summary |
|---|---|
| public SSLContextBuilder() | |
| build | back to summary |
|---|---|
| public SSLContext build() throws NoSuchAlgorithmException, KeyManagementException | |
| create | back to summary |
|---|---|
| public static SSLContextBuilder create() | |
| initSSLContext | back to summary |
|---|---|
| protected void initSSLContext(final SSLContext sslContext, final Collection<KeyManager> keyManagers, final Collection<TrustManager> trustManagers, final SecureRandom secureRandom) throws KeyManagementException | |
| loadKeyMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadKeyMaterial(final KeyStore keystore, final char[] keyPassword, final PrivateKeyStrategy aliasStrategy) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException | |
| loadKeyMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadKeyMaterial(final KeyStore keystore, final char[] keyPassword) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException | |
| loadKeyMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadKeyMaterial(final File file, final char[] storePassword, final char[] keyPassword, final PrivateKeyStrategy aliasStrategy) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException, CertificateException, IOException | |
| loadKeyMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadKeyMaterial(final File file, final char[] storePassword, final char[] keyPassword) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException, CertificateException, IOException | |
| loadKeyMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadKeyMaterial(final URL url, final char[] storePassword, final char[] keyPassword, final PrivateKeyStrategy aliasStrategy) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException, CertificateException, IOException | |
| loadKeyMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadKeyMaterial(final URL url, final char[] storePassword, final char[] keyPassword) throws NoSuchAlgorithmException, KeyStoreException, UnrecoverableKeyException, CertificateException, IOException | |
| loadTrustMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadTrustMaterial(final KeyStore truststore, final TrustStrategy trustStrategy) throws NoSuchAlgorithmException, KeyStoreException | |
| loadTrustMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadTrustMaterial(final TrustStrategy trustStrategy) throws NoSuchAlgorithmException, KeyStoreException | |
| loadTrustMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadTrustMaterial(final File file, final char[] storePassword, final TrustStrategy trustStrategy) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException | |
| loadTrustMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadTrustMaterial(final File file, final char[] storePassword) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException | |
| loadTrustMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadTrustMaterial(final File file) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException | |
| loadTrustMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadTrustMaterial(final URL url, final char[] storePassword, final TrustStrategy trustStrategy) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException | |
| loadTrustMaterial | back to summary |
|---|---|
| public SSLContextBuilder loadTrustMaterial(final URL url, final char[] storePassword) throws NoSuchAlgorithmException, KeyStoreException, CertificateException, IOException | |
| setKeyManagerFactoryAlgorithm | back to summary |
|---|---|
| public SSLContextBuilder setKeyManagerFactoryAlgorithm(final String keyManagerFactoryAlgorithm) Sets the key manager factory algorithm name.
| |
| setKeyStoreType | back to summary |
|---|---|
| public SSLContextBuilder setKeyStoreType(final String keyStoreType) Sets the key store type.
| |
| setProtocol | back to summary |
|---|---|
| public SSLContextBuilder setProtocol(final String protocol) Sets the SSLContext protocol algorithm name.
| |
| setProvider | back to summary |
|---|---|
| public SSLContextBuilder setProvider(final Provider provider) | |
| setProvider | back to summary |
|---|---|
| public SSLContextBuilder setProvider(final String name) | |
| setSecureRandom | back to summary |
|---|---|
| public SSLContextBuilder setSecureRandom(final SecureRandom secureRandom) | |
| setTrustManagerFactoryAlgorithm | back to summary |
|---|---|
| public SSLContextBuilder setTrustManagerFactoryAlgorithm(final String trustManagerFactoryAlgorithm) Sets the trust manager factory algorithm name.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| useProtocol | back to summary |
|---|---|
| public SSLContextBuilder useProtocol(final String protocol)
Deprecated Use Sets the SSLContext protocol algorithm name.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final PrivateKeyStrategy | |
| private final X509ExtendedKeyManager |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public String | chooseClientAlias(final String[]
the key algorithm type name(s), ordered
with the most-preferred key type first. keyTypes, final Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers, final Socket the socket to be used for this connection. This
parameter can be null, which indicates that
implementations are free to select an alias applicable
to any socket. socket)Implements javax. |
| public String | chooseEngineClientAlias(final String[]
the key algorithm type name(s), ordered
with the most-preferred key type first. keyTypes, final Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers, final SSLEngine the sslEngine)SSLEngine to be used for this
connection. This parameter can be null, which indicates
that implementations of this interface are free to
select an alias applicable to any engine.Overrides javax. SSLEngine connection given the public key type
and the list of certificate issuer authorities recognized by
the peer (if any).
|
| public String | chooseEngineServerAlias(final String
the key algorithm type name. keyType, final Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers, final SSLEngine the sslEngine)SSLEngine to be used for this
connection. This parameter can be null, which indicates
that implementations of this interface are free to
select an alias applicable to any engine.Overrides javax. SSLEngine connection given the public key type
and the list of certificate issuer authorities recognized by
the peer (if any).
|
| public String | chooseServerAlias(final String
the key algorithm type name. keyType, final Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers, final Socket the socket to be used for this connection. This
parameter can be null, which indicates that
implementations are free to select an alias applicable
to any socket. socket)Implements javax. |
| public X509Certificate[] | getCertificateChain(final String
the alias name alias)Implements javax. |
| public String[] | getClientAliases(final String
the key algorithm type name keyType, final Principal[] the list of acceptable CA issuer subject names,
or null if it does not matter which issuers are used. issuers)Implements javax. |
| public Map | |
| public PrivateKey | getPrivateKey(final String
the alias name alias)Implements javax. |
| public String[] | getServerAliases(final String
the key algorithm type name keyType, final Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers)Implements javax. |
| public Map |
| aliasStrategy | back to summary |
|---|---|
| private final PrivateKeyStrategy aliasStrategy | |
| keyManager | back to summary |
|---|---|
| private final X509ExtendedKeyManager keyManager | |
| KeyManagerDelegate | back to summary |
|---|---|
| pack-priv KeyManagerDelegate(final X509ExtendedKeyManager keyManager, final PrivateKeyStrategy aliasStrategy) | |
| chooseClientAlias | back to summary |
|---|---|
| public String chooseClientAlias(final String[] keyTypes, final Principal[] issuers, final Socket socket) Implements javax. Doc from javax. Choose an alias to authenticate the client side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).
| |
| chooseEngineClientAlias | back to summary |
|---|---|
| public String chooseEngineClientAlias(final String[] keyTypes, final Principal[] issuers, final SSLEngine sslEngine) Overrides javax. Doc from javax. Choose an alias to authenticate the client side of an
The default implementation returns null.
| |
| chooseEngineServerAlias | back to summary |
|---|---|
| public String chooseEngineServerAlias(final String keyType, final Principal[] issuers, final SSLEngine sslEngine) Overrides javax. Doc from javax. Choose an alias to authenticate the server side of an
The default implementation returns null.
| |
| chooseServerAlias | back to summary |
|---|---|
| public String chooseServerAlias(final String keyType, final Principal[] issuers, final Socket socket) Implements javax. Doc from javax. Choose an alias to authenticate the server side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any).
| |
| getCertificateChain | back to summary |
|---|---|
| public X509Certificate[] getCertificateChain(final String alias) Implements javax. Doc from javax. Returns the certificate chain associated with the given alias.
| |
| getClientAliases | back to summary |
|---|---|
| public String[] getClientAliases(final String keyType, final Principal[] issuers) Implements javax. Doc from javax. Get the matching aliases for authenticating the client side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any). | |
| getClientAliasMap | back to summary |
|---|---|
| public Map | |
| getPrivateKey | back to summary |
|---|---|
| public PrivateKey getPrivateKey(final String alias) Implements javax. Doc from javax. Returns the key associated with the given alias.
| |
| getServerAliases | back to summary |
|---|---|
| public String[] getServerAliases(final String keyType, final Principal[] issuers) Implements javax. Doc from javax. Get the matching aliases for authenticating the server side of a secure socket given the public key type and the list of certificate issuer authorities recognized by the peer (if any). | |
| getServerAliasMap | back to summary |
|---|---|
| public Map | |
| Modifier and Type | Field and Description |
|---|---|
| private final X509TrustManager | |
| private final TrustStrategy |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | checkClientTrusted(final X509Certificate[]
the peer certificate chain chain, final String the authentication type based on the client certificate authType)Implements javax. |
| public void | checkServerTrusted(final X509Certificate[]
the peer certificate chain chain, final String the key exchange algorithm used authType)Implements javax. |
| public X509Certificate[] | getAcceptedIssuers()
Implements javax. |
| trustManager | back to summary |
|---|---|
| private final X509TrustManager trustManager | |
| trustStrategy | back to summary |
|---|---|
| private final TrustStrategy trustStrategy | |
| TrustManagerDelegate | back to summary |
|---|---|
| pack-priv TrustManagerDelegate(final X509TrustManager trustManager, final TrustStrategy trustStrategy) | |
| checkClientTrusted | back to summary |
|---|---|
| public void checkClientTrusted(final X509Certificate[] chain, final String authType) throws CertificateException Implements javax. Doc from javax. Given the partial or complete certificate chain provided by the peer, build a certificate path to a trusted root and return if it can be validated and is trusted for client SSL authentication based on the authentication type. The authentication type is determined by the actual certificate used. For instance, if RSAPublicKey is used, the authType should be "RSA". Checking is case-sensitive.
| |
| checkServerTrusted | back to summary |
|---|---|
| public void checkServerTrusted(final X509Certificate[] chain, final String authType) throws CertificateException Implements javax. Doc from javax. Given the partial or complete certificate chain provided by the peer, build a certificate path to a trusted root and return if it can be validated and is trusted for server SSL authentication based on the authentication type. The authentication type is the key exchange algorithm portion of the cipher suites represented as a String, such as "RSA", "DHE_DSS". Note for some exportable cipher suites, the key exchange algorithm is determined at run time during the handshake. For instance, for TLS_RSA_EXPORT_WITH_RC4_40_MD5, the authType should be RSA_EXPORT when an ephemeral RSA key is used for the key exchange, and RSA when the key from the server certificate is used. Checking is case-sensitive.
| |
| getAcceptedIssuers | back to summary |
|---|---|
| public X509Certificate[] getAcceptedIssuers() Implements javax. Doc from javax. Return an array of certificate authority certificates which are trusted for authenticating peers.
| |