public final class ExtendedAliasKeyManager extends X509ExtendedKeyManager
Constructor and Description |
---|
ExtendedAliasKeyManager(KeyManager mgr,
String keyAlias)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
chooseClientAlias(String[] keyType,
Principal[] issuers,
Socket socket)
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).
|
String |
chooseEngineClientAlias(String[] keyType,
Principal[] issuers,
SSLEngine engine)
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).
|
String |
chooseEngineServerAlias(String keyType,
Principal[] issuers,
SSLEngine engine)
Returns this key manager's server key alias that was provided in the
constructor if matching the key type.
|
String |
chooseServerAlias(String keyType,
Principal[] issuers,
Socket socket)
Returns this key manager's server key alias that was provided in the
constructor if matching the key type.
|
X509Certificate[] |
getCertificateChain(String alias)
Returns the certificate chain associated with the given alias.
|
String[] |
getClientAliases(String keyType,
Principal[] issuers)
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).
|
PrivateKey |
getPrivateKey(String alias)
Returns the key associated with the given alias.
|
String[] |
getServerAliases(String keyType,
Principal[] issuers)
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).
|
public ExtendedAliasKeyManager(KeyManager mgr, String keyAlias)
mgr
- The X509KeyManager used as a delegatekeyAlias
- The alias name of the server's keypair and supporting
certificate chainpublic String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)
keyType
- The key algorithm type name(s), ordered with the
most-preferred key type firstissuers
- The list of acceptable CA issuer subject names, or null if it
does not matter which issuers are usedsocket
- The socket to be used for this connection. This parameter can
be null, in which case this method will return the most
generic alias to usepublic String chooseServerAlias(String keyType, Principal[] issuers, Socket socket)
keyType
- The key algorithm type nameissuers
- The list of acceptable CA issuer subject names, or null if it
does not matter which issuers are used (ignored)socket
- The socket to be used for this connection. This parameter can
be null, in which case this method will return the most
generic alias to use (ignored)public X509Certificate[] getCertificateChain(String alias)
alias
- The alias namepublic String[] getClientAliases(String keyType, Principal[] issuers)
keyType
- The key algorithm type nameissuers
- The list of acceptable CA issuer subject names, or null if it
does not matter which issuers are usedpublic String[] getServerAliases(String keyType, Principal[] issuers)
keyType
- The key algorithm type nameissuers
- The list of acceptable CA issuer subject names, or null if it
does not matter which issuers are usedpublic PrivateKey getPrivateKey(String alias)
alias
- The alias namepublic String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine)
chooseEngineClientAlias
in class X509ExtendedKeyManager
keyType
- The key algorithm type nameissuers
- The list of acceptable CA issuer subject names, or null if it
does not matter which issuers are used (ignored)engine
- The engine to be used for this connection.public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine)
chooseEngineServerAlias
in class X509ExtendedKeyManager
keyType
- The key algorithm type nameissuers
- The list of acceptable CA issuer subject names, or null if it
does not matter which issuers are used (ignored)engine
- The engine to be used for this connection.Copyright © 2003–2023 The Apache Software Foundation. All rights reserved.