Package org.postgresql.ssl
Class LazyKeyManager
java.lang.Object
org.postgresql.ssl.LazyKeyManager
- All Implemented Interfaces:
KeyManager
,X509KeyManager
A Key manager that only loads the keys, if necessary.
-
Constructor Summary
ConstructorDescriptionLazyKeyManager
(@Nullable String certfile, @Nullable String keyfile, CallbackHandler cbh, boolean defaultfile) Constructor. -
Method Summary
Modifier and TypeMethodDescription@Nullable String
chooseClientAlias
(String[] keyType, Principal @Nullable [] issuers, @Nullable Socket socket) @Nullable String
chooseServerAlias
(String keyType, Principal @Nullable [] issuers, @Nullable Socket socket) X509Certificate @Nullable []
getCertificateChain
(String alias) String @Nullable []
getClientAliases
(String keyType, Principal @Nullable [] issuers) @Nullable PrivateKey
getPrivateKey
(String alias) String @Nullable []
getServerAliases
(String keyType, Principal @Nullable [] issuers) void
getCertificateChain and getPrivateKey cannot throw exceptions, therefore any exception is stored inerror
and can be raised by this method.
-
Constructor Details
-
LazyKeyManager
public LazyKeyManager(@Nullable String certfile, @Nullable 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
- certfilekeyfile
- key filecbh
- callback handlerdefaultfile
- default file
-
-
Method Details
-
throwKeyManagerException
getCertificateChain and getPrivateKey cannot throw exceptions, therefore any exception is stored inerror
and can be raised by this method.- Throws:
PSQLException
- if any exception is stored inerror
and can be raised
-
chooseClientAlias
public @Nullable String chooseClientAlias(String[] keyType, Principal @Nullable [] issuers, @Nullable Socket socket) - Specified by:
chooseClientAlias
in interfaceX509KeyManager
-
chooseServerAlias
public @Nullable String chooseServerAlias(String keyType, Principal @Nullable [] issuers, @Nullable Socket socket) - Specified by:
chooseServerAlias
in interfaceX509KeyManager
-
getCertificateChain
- Specified by:
getCertificateChain
in interfaceX509KeyManager
-
getClientAliases
- Specified by:
getClientAliases
in interfaceX509KeyManager
-
getPrivateKey
- Specified by:
getPrivateKey
in interfaceX509KeyManager
-
getServerAliases
- Specified by:
getServerAliases
in interfaceX509KeyManager
-