Class OnDemandKeyManager
- java.lang.Object
-
- javax.net.ssl.X509ExtendedKeyManager
-
- com.impossibl.postgres.protocol.ssl.OnDemandKeyManager
-
- All Implemented Interfaces:
KeyManager
,X509KeyManager
public class OnDemandKeyManager extends X509ExtendedKeyManager
A Key manager that only loads the keys, if necessary.
-
-
Constructor Summary
Constructors Constructor Description OnDemandKeyManager(String certfile, String keyfile, CallbackHandler cbh, boolean defaultfile)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)
String
chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine)
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)
void
throwKeyManagerException()
getCertificateChain and getPrivateKey cannot throw exeptions, therefore any exception is stored in this.error and can be raised by this method-
Methods inherited from class javax.net.ssl.X509ExtendedKeyManager
chooseEngineServerAlias
-
-
-
-
Constructor Detail
-
OnDemandKeyManager
public OnDemandKeyManager(String certfile, String keyfile, CallbackHandler cbh, boolean defaultfile)
Constructor. certfile and keyfile can be null, in that case no certificate is presented to the server.- Parameters:
certfile
-keyfile
-cbh
-defaultfile
-
-
-
Method Detail
-
throwKeyManagerException
public void throwKeyManagerException() throws SQLException
getCertificateChain and getPrivateKey cannot throw exeptions, therefore any exception is stored in this.error and can be raised by this method- Throws:
SQLException
-
chooseClientAlias
public String chooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)
-
chooseServerAlias
public String chooseServerAlias(String keyType, Principal[] issuers, Socket socket)
-
getCertificateChain
public X509Certificate[] getCertificateChain(String alias)
-
getPrivateKey
public PrivateKey getPrivateKey(String alias)
-
chooseEngineClientAlias
public String chooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine)
- Overrides:
chooseEngineClientAlias
in classX509ExtendedKeyManager
-
-