Top Description Inners Fields Constructors Methods
org.postgresql.ssl

public Class LibPQFactory

extends WrappedFactory
Class Inheritance
Known Direct Subclasses
org.postgresql.ssl.jdbc4.LibPQFactory
Static Imports
org.postgresql.util.internal.Nullness.castNonNull

Provide an SSLSocketFactory that is compatible with the libpq behaviour.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
LibPQFactory.ConsoleCallbackHandler

A CallbackHandler that reads the password from the console or returns the password given to its constructor.

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv @Nullable KeyManager
Inherited from org.postgresql.ssl.WrappedFactory:
factory

Constructor Summary

AccessConstructor and Description
public
LibPQFactory(Properties
the connection parameters The following parameters are used: sslmode,sslcert,sslkey,sslrootcert,sslhostnameverifier,sslpasswordcallback,sslpassword
info
)

Method Summary

Modifier and TypeMethod and Description
private CallbackHandler
private void
initP12(String sslkeyfile, Properties info)

private void
initPk8(String sslkeyfile, String defaultdir, Properties info)

public void
throwKeyManagerException()

Propagates any exception from LazyKeyManager.

Inherited from org.postgresql.ssl.WrappedFactory:
createSocketcreateSocketcreateSocketcreateSocketcreateSocketgetDefaultCipherSuitesgetSupportedCipherSuites

Field Detail

defaultfileback to summary
pack-priv boolean defaultfile
kmback to summary
pack-priv @Nullable KeyManager km

Constructor Detail

LibPQFactoryback to summary
public LibPQFactory(Properties info) throws PSQLException
Parameters
info:Properties

the connection parameters The following parameters are used: sslmode,sslcert,sslkey,sslrootcert,sslhostnameverifier,sslpasswordcallback,sslpassword

Exceptions
PSQLException:
if security error appears when initializing factory

Method Detail

getCallbackHandlerback to summary
private CallbackHandler getCallbackHandler(Properties info) throws PSQLException
initP12back to summary
private void initP12(String sslkeyfile, Properties info) throws PSQLException
initPk8back to summary
private void initPk8(String sslkeyfile, String defaultdir, Properties info) throws PSQLException
throwKeyManagerExceptionback to summary
public void throwKeyManagerException() throws PSQLException

Propagates any exception from LazyKeyManager.

Exceptions
PSQLException:
if there is an exception to propagate
org.postgresql.ssl back to summary

public Class LibPQFactory.ConsoleCallbackHandler

extends Object
implements CallbackHandler
Class Inheritance
All Implemented Interfaces
javax.security.auth.callback.CallbackHandler

A CallbackHandler that reads the password from the console or returns the password given to its constructor.

Field Summary

Modifier and TypeField and Description
private @Nullable char[]

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
handle(Callback[]
The callbacks to handle
callbacks
)

Implements javax.security.auth.callback.CallbackHandler.handle.

Handles the callbacks.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

passwordback to summary
private @Nullable char[] password

Constructor Detail

ConsoleCallbackHandlerback to summary
pack-priv ConsoleCallbackHandler(@Nullable String password)

Method Detail

handleback to summary
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException

Implements javax.security.auth.callback.CallbackHandler.handle.

Handles the callbacks.

Parameters
callbacks:Callback[]

The callbacks to handle

Annotations
@Override
Exceptions
IOException:

Doc from javax.security.auth.callback.CallbackHandler.handle.

if an input or output error occurs.

UnsupportedCallbackException:
If the console is not available or other than PasswordCallback is supplied