A X509ExtendedKeyManager that selects a key with an alias
retrieved from SNI information, delegating other processing to a nested X509ExtendedKeyManager.
Can only be used on server side.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | SniX509ExtendedKeyManager.SniSelector
Selects a certificate based on SNI information. |
| Modifier and Type | Field and Description |
|---|---|
| private UnaryOperator | |
| private final X509ExtendedKeyManager | |
| private final SslContextFactory. | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| public | SniX509ExtendedKeyManager(X509ExtendedKeyManager keyManager, SslContextFactory.
|
| Modifier and Type | Method and Description |
|---|---|
| public String | chooseClientAlias(String[]
the key algorithm type name(s), ordered
with the most-preferred key type first. keyType, Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers, 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(String[]
the key algorithm type name(s), ordered
with the most-preferred key type first. keyType, Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers, SSLEngine the engine)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(String
the key algorithm type name. keyType, Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers, SSLEngine the engine)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).
|
| protected String | chooseServerAlias(String keyType, Principal[] issuers, Collection<SNIMatcher> matchers, SSLSession session)
|
| public String | chooseServerAlias(String
the key algorithm type name. keyType, Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers, 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 UnaryOperator | |
| public X509Certificate[] | getCertificateChain(String
the alias name alias)Implements javax. |
| public String[] | getClientAliases(String
the key algorithm type name keyType, Principal[] the list of acceptable CA issuer subject names,
or null if it does not matter which issuers are used. issuers)Implements javax. |
| public PrivateKey | getPrivateKey(String
the alias name alias)Implements javax. |
| public String[] | getServerAliases(String
the key algorithm type name keyType, Principal[] the list of acceptable CA issuer subject names
or null if it does not matter which issuers are used. issuers)Implements javax. |
| public void | setAliasMapper(UnaryOperator<String>
the function that transforms the alias aliasMapper)Sets a function that transforms the alias into a possibly different alias, invoked when the SNI logic must choose the alias to pick the right certificate. |
| _aliasMapper | back to summary |
|---|---|
| private UnaryOperator<String> _aliasMapper | |
| _delegate | back to summary |
|---|---|
| private final X509ExtendedKeyManager _delegate | |
| _sslContextFactory | back to summary |
|---|---|
| private final SslContextFactory. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| SniX509ExtendedKeyManager | back to summary |
|---|---|
| public SniX509ExtendedKeyManager(X509ExtendedKeyManager keyManager, SslContextFactory. | |
| chooseClientAlias | back to summary |
|---|---|
| public String chooseClientAlias(String[] keyType, Principal[] issuers, 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(String[] keyType, Principal[] issuers, SSLEngine engine) 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(String keyType, Principal[] issuers, SSLEngine engine) Overrides javax. Doc from javax. Choose an alias to authenticate the server side of an
The default implementation returns null.
| |
| chooseServerAlias | back to summary |
|---|---|
| protected String chooseServerAlias(String keyType, Principal[] issuers, Collection<SNIMatcher> matchers, SSLSession session) | |
| chooseServerAlias | back to summary |
|---|---|
| public String chooseServerAlias(String keyType, Principal[] issuers, 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).
| |
| getAliasMapper | back to summary |
|---|---|
public UnaryOperator
| |
| getCertificateChain | back to summary |
|---|---|
| public X509Certificate[] getCertificateChain(String alias) Implements javax. Doc from javax. Returns the certificate chain associated with the given alias.
| |
| getClientAliases | back to summary |
|---|---|
| public String[] getClientAliases(String keyType, 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). | |
| getPrivateKey | back to summary |
|---|---|
| public PrivateKey getPrivateKey(String alias) Implements javax. Doc from javax. Returns the key associated with the given alias.
| |
| getServerAliases | back to summary |
|---|---|
| public String[] getServerAliases(String keyType, 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). | |
| setAliasMapper | back to summary |
|---|---|
| public void setAliasMapper(UnaryOperator<String> aliasMapper) Sets a function that transforms the alias into a possibly different alias, invoked when the SNI logic must choose the alias to pick the right certificate. This function is required when using the
Other implementations such as BouncyCastle have been reported to mangle
the alias in a different way, namely This function allows to "unmangle" the alias from the implementation
specific mangling back to just
| |
Selects a certificate based on SNI information.
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the alias of the certificate to return to the client, from thecertificates list,
or SniSelector#DELEGATE if the certificate choice should be delegated to the
nested key manager or null for no match.the key algorithm type name keyType, Principal[] the list of acceptable CA issuer subject names or null if it does not matter which issuers are used issuers, SSLSession the TLS handshake session or null if not known. session, String the server name indication sent by the client, or null if the client did not send the server name indication sniHost, Collection<X509> the list of certificates matching certificates)keyType and issuers known to this SslContextFactorySelects a certificate based on SNI information. |
| DELEGATE | back to summary |
|---|---|
| public static final String DELEGATE | |
| sniSelect | back to summary |
|---|---|
| public String sniSelect(String keyType, Principal[] issuers, SSLSession session, String sniHost, Collection<X509> certificates) throws SSLHandshakeException Selects a certificate based on SNI information. This method may be invoked multiple times during the TLS handshake, with different parameters.
For example, the
| |