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 StringchooseClientAlias(String[] keyType, Principal[] issuers, Socket socket)StringchooseEngineClientAlias(String[] keyType, Principal[] issuers, SSLEngine engine)StringchooseServerAlias(String keyType, Principal[] issuers, Socket socket)X509Certificate[]getCertificateChain(String alias)String[]getClientAliases(String keyType, Principal[] issuers)PrivateKeygetPrivateKey(String alias)String[]getServerAliases(String keyType, Principal[] issuers)voidthrowKeyManagerException()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 SQLExceptiongetCertificateChain 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:
chooseEngineClientAliasin classX509ExtendedKeyManager
-
-