public class StaticKeyManager extends Object implements X509KeyManager
FileServer
is always selected for authoriation independent of
other settings.Modifier and Type | Field and Description |
---|---|
private String |
alias |
private KeyStore |
keyStore |
private char[] |
password |
Constructor and Description |
---|
StaticKeyManager(KeyStore keyStore,
String alias,
String password)
Create a new key manager
|
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) |
private final KeyStore keyStore
private final String alias
private final char[] password
public StaticKeyManager(KeyStore keyStore, String alias, String password) throws KeyStoreException
keyStore
- The key-store containing the client certificatealias
- The alias of the key-store entry to use, or null to use
the first entry in the key-storepassword
- The password that is required to unlock the entryKeyStoreException
public 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