public class AliasKeyManager extends Object implements X509KeyManager
KeyManager
that allows using an aliasConstructor and Description |
---|
AliasKeyManager(X509KeyManager km,
String alias) |
Modifier and Type | Method and Description |
---|---|
String |
chooseClientAlias(String[] keyType,
Principal[] issuers,
Socket socket) |
String |
chooseServerAlias(String keyType,
Principal[] issuers,
Socket socket) |
X509Certificate[] |
getCertificateChain(String alias) |
String[] |
getClientAliases(String keyType,
Principal[] issuers) |
PrivateKey |
getPrivateKey(String alias) |
String[] |
getServerAliases(String keyType,
Principal[] issuers) |
static AliasKeyManager[] |
wrap(KeyManager[] kms,
String alias)
Wraps the first found
X509KeyManager that has a private key for
the given alias as an AliasKeyManager and returns it as
the only element in a newly created array. |
public AliasKeyManager(X509KeyManager km, String alias)
public static AliasKeyManager[] wrap(KeyManager[] kms, String alias)
X509KeyManager
that has a private key for
the given alias
as an AliasKeyManager
and returns it as
the only element in a newly created array.kms
- the KeyManagers to be searched for the alias
alias
- the name to be searched forAliasKeyManager
that has a private key
named alias
IllegalArgumentException
- if no valid KeyManager is foundpublic String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)
chooseClientAlias
in interface X509KeyManager
public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket)
chooseServerAlias
in interface X509KeyManager
public X509Certificate[] getCertificateChain(String alias)
getCertificateChain
in interface X509KeyManager
public String[] getClientAliases(String keyType, Principal[] issuers)
getClientAliases
in interface X509KeyManager
public PrivateKey getPrivateKey(String alias)
getPrivateKey
in interface X509KeyManager
public String[] getServerAliases(String keyType, Principal[] issuers)
getServerAliases
in interface X509KeyManager
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.