public class CustomKeyManager extends X509ExtendedKeyManager implements KeyManager, X509KeyManager
Keymanager enables specification of key alias to be used.
Constructor and Description |
---|
CustomKeyManager(String keyStoreFile,
String password,
String alias)
Convenience constructor.
|
Modifier and Type | Method and Description |
---|---|
String |
chooseClientAlias(String[] param1,
Principal[] param2,
Socket param3)
Dummy method always returning the preselected alias.
|
String |
chooseEngineClientAlias(String[] keyType,
Principal[] issuers,
SSLEngine engine) |
String |
chooseEngineServerAlias(String keyType,
Principal[] issuers,
SSLEngine engine) |
String |
chooseServerAlias(String param1,
Principal[] param2)
Dummy method always returning the preselected alias.
|
String |
chooseServerAlias(String keyType,
Principal[] issuers,
Socket socket)
Alias choser always returning the desired alias.
|
X509Certificate[] |
getCertificateChain(String alias)
Obtain certificate chain of a certificate from keystore.
|
String[] |
getClientAliases(String param1,
Principal[] param2)
Dummy method always returning the preselected alias.
|
PrivateKey |
getPrivateKey(String alias)
Obtain private key from keystore.
|
String[] |
getServerAliases(String param1,
Principal[] param2)
Dummy method always returning the preselected alias.
|
public CustomKeyManager(String keyStoreFile, String password, String alias) throws GeneralSecurityException
Convenience constructor.
keyStoreFile
- name of the JKS keystore filepassword
- password to open the kestore filealias
- alias of the certificate to be usedGeneralSecurityException
- if keystore generation failspublic final PrivateKey getPrivateKey(String alias)
Obtain private key from keystore.
getPrivateKey
in interface X509KeyManager
alias
- alias of the certificate to be usedpublic X509Certificate[] getCertificateChain(String alias)
Obtain certificate chain of a certificate from keystore.
getCertificateChain
in interface X509KeyManager
alias
- alias of the certificate to be usedpublic String[] getClientAliases(String param1, Principal[] param2)
Dummy method always returning the preselected alias.
getClientAliases
in interface X509KeyManager
param1
- dummyparam2
- dummypublic String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine)
chooseEngineClientAlias
in class X509ExtendedKeyManager
public String chooseEngineServerAlias(String keyType, Principal[] issuers, SSLEngine engine)
chooseEngineServerAlias
in class X509ExtendedKeyManager
public String chooseClientAlias(String[] param1, Principal[] param2, Socket param3)
Dummy method always returning the preselected alias.
chooseClientAlias
in interface X509KeyManager
param1
- dummyparam2
- dummyparam3
- dummypublic String[] getServerAliases(String param1, Principal[] param2)
Dummy method always returning the preselected alias.
getServerAliases
in interface X509KeyManager
param1
- dummyparam2
- dummypublic String chooseServerAlias(String keyType, Principal[] issuers, Socket socket)
Alias choser always returning the desired alias.
chooseServerAlias
in interface X509KeyManager
keyType
- type of key to be looked forissuers
- issuers acceptedsocket
- socket requiring the certificateCopyright © 2023. All rights reserved.