Package org.postgresql.ssl
Class LazyKeyManager
- java.lang.Object
-
- org.postgresql.ssl.LazyKeyManager
-
- All Implemented Interfaces:
javax.net.ssl.KeyManager,javax.net.ssl.X509KeyManager
public class LazyKeyManager extends java.lang.Object implements javax.net.ssl.X509KeyManagerA Key manager that only loads the keys, if necessary.
-
-
Constructor Summary
Constructors Constructor Description LazyKeyManager(java.lang.String certfile, java.lang.String keyfile, javax.security.auth.callback.CallbackHandler cbh, boolean defaultfile)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringchooseClientAlias(java.lang.String[] keyType, java.security.Principal[] issuers, java.net.Socket socket)java.lang.StringchooseServerAlias(java.lang.String keyType, java.security.Principal[] issuers, java.net.Socket socket)java.security.cert.X509Certificate[]getCertificateChain(java.lang.String alias)java.lang.String[]getClientAliases(java.lang.String keyType, java.security.Principal[] issuers)java.security.PrivateKeygetPrivateKey(java.lang.String alias)java.lang.String[]getServerAliases(java.lang.String keyType, java.security.Principal[] issuers)voidthrowKeyManagerException()getCertificateChain and getPrivateKey cannot throw exceptions, therefore any exception is stored inerrorand can be raised by this method.
-
-
-
Constructor Detail
-
LazyKeyManager
public LazyKeyManager(java.lang.String certfile, java.lang.String keyfile, javax.security.auth.callback.CallbackHandler cbh, boolean defaultfile)Constructor. certfile and keyfile can be null, in that case no certificate is presented to the server.- Parameters:
certfile- certfilekeyfile- key filecbh- callback handlerdefaultfile- default file
-
-
Method Detail
-
throwKeyManagerException
public void throwKeyManagerException() throws PSQLExceptiongetCertificateChain and getPrivateKey cannot throw exceptions, therefore any exception is stored inerrorand can be raised by this method.- Throws:
PSQLException- if any exception is stored inerrorand can be raised
-
chooseClientAlias
public java.lang.String chooseClientAlias(java.lang.String[] keyType, java.security.Principal[] issuers, java.net.Socket socket)- Specified by:
chooseClientAliasin interfacejavax.net.ssl.X509KeyManager
-
chooseServerAlias
public java.lang.String chooseServerAlias(java.lang.String keyType, java.security.Principal[] issuers, java.net.Socket socket)- Specified by:
chooseServerAliasin interfacejavax.net.ssl.X509KeyManager
-
getCertificateChain
public java.security.cert.X509Certificate[] getCertificateChain(java.lang.String alias)
- Specified by:
getCertificateChainin interfacejavax.net.ssl.X509KeyManager
-
getClientAliases
public java.lang.String[] getClientAliases(java.lang.String keyType, java.security.Principal[] issuers)- Specified by:
getClientAliasesin interfacejavax.net.ssl.X509KeyManager
-
getPrivateKey
public java.security.PrivateKey getPrivateKey(java.lang.String alias)
- Specified by:
getPrivateKeyin interfacejavax.net.ssl.X509KeyManager
-
getServerAliases
public java.lang.String[] getServerAliases(java.lang.String keyType, java.security.Principal[] issuers)- Specified by:
getServerAliasesin interfacejavax.net.ssl.X509KeyManager
-
-