Class JdbcPasswordEncryptor

java.lang.Object
org.kawanfw.sql.api.server.auth.JdbcPasswordEncryptor

public class JdbcPasswordEncryptor
extends Object
Tooling class that allows to generate to hashed/encrypted passwords for JdbcUserAuthenticator. The encrypted passwords are to be inserted in the users table.

The hash parameters (algorithm, iterations, salt) are defined in the aceql-sever.properties.

The encryptPassword(String) method may be called from a Java program:

    File file = new File("/path/to/aceql-server.properties");
    String password = "myPassword";
    
    JdbcPasswordEncryptor jdbcPasswordEncryptor = new JdbcPasswordEncryptor(file);
    String encryptedPassword = jdbcPasswordEncryptor.encryptPassword(password);
    System.out.println(encryptedPassword);
 
It may also be run as command line:
  • Open a command line on Windows or Linux/Bash.
  • cd <installation-directory>/AceQL/bin
  • Windows: run jdbc_password_encryptor.bat -help
  • Linux: run jdbc_password_encryptor -help
Since:
10.1
Author:
Nicolas de Pomereu
  • Constructor Details

  • Method Details

    • encryptPassword

      public String encryptPassword​(String password)
      Encrypts the password passed as parameter.
      Parameters:
      password - the password to encrypt
      Returns:
      the encrypted value of the password
    • main

      public static void main​(String[] args) throws org.apache.commons.cli.ParseException, DatabaseConfigurationException, IOException
      Allows to encrypt password for the JdbcUserAuthenticator implementation.
      A call with the clear password as parameter will print the encrypted password.
      Parameters:
      args - the arguments: pass "-help" to have arguments list.
      Throws:
      org.apache.commons.cli.ParseException - if any Exception when parsing command line
      IOException - if any I/O Exception
      DatabaseConfigurationException - if any error in configuration properties file