Class LibPQFactory

  • Direct Known Subclasses:
    LibPQFactory

    public class LibPQFactory
    extends WrappedFactory
    Provide an SSLSocketFactory that is compatible with the libpq behaviour.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  LibPQFactory.ConsoleCallbackHandler
      A CallbackHandler that reads the password from the console or returns the password given to its constructor.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) boolean defaultfile  
      (package private) javax.net.ssl.KeyManager km  
    • Constructor Summary

      Constructors 
      Constructor Description
      LibPQFactory​(java.util.Properties info)  
    • Field Detail

      • km

        javax.net.ssl.KeyManager km
      • defaultfile

        boolean defaultfile
    • Constructor Detail

      • LibPQFactory

        public LibPQFactory​(java.util.Properties info)
                     throws PSQLException
        Parameters:
        info - the connection parameters The following parameters are used: sslmode,sslcert,sslkey,sslrootcert,sslhostnameverifier,sslpasswordcallback,sslpassword
        Throws:
        PSQLException - if security error appears when initializing factory
    • Method Detail

      • getCallbackHandler

        private javax.security.auth.callback.CallbackHandler getCallbackHandler​(java.util.Properties info)
                                                                         throws PSQLException
        Throws:
        PSQLException
      • getCertFilePath

        private java.lang.String getCertFilePath​(java.lang.String defaultdir,
                                                 java.util.Properties info)
      • initPk8

        private void initPk8​(java.lang.String sslkeyfile,
                             java.lang.String defaultdir,
                             java.util.Properties info)
                      throws PSQLException
        Throws:
        PSQLException
      • initP12

        private void initP12​(java.lang.String sslkeyfile,
                             java.util.Properties info)
                      throws PSQLException
        Throws:
        PSQLException
      • initPEM

        private void initPEM​(java.lang.String sslKeyFile,
                             java.lang.String defaultdir,
                             java.util.Properties info)
                      throws PSQLException
        Throws:
        PSQLException