Package org.apache.openejb.resource.jdbc.cipher

Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher.decrypt()


            }

            // check password codec if available
            if (null != passwordCipher) {
                PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(passwordCipher);
                String plainPwd = cipher.decrypt(password.toCharArray());

                // override previous password value
                super.setPassword(plainPwd);
            }
View Full Code Here


            }

            // check password codec if available
            if (null != passwordCipher) {
                PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(passwordCipher);
                String plainPwd = cipher.decrypt(password.toCharArray());

                // override previous password value
                super.setPassword(plainPwd);
            }
View Full Code Here

            PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(cipherName);

            if (line.hasOption("decrypt")) {
                String pwdArg = (String) line.getArgList().get(0);
                char[] encryptdPassword = pwdArg.toCharArray();
                System.out.println(cipher.decrypt(encryptdPassword));

            } else { // if option neither encrypt/decrypt is specified, we assume
                     // it is encrypt.
                String plainPassword = (String) line.getArgList().get(0);
                System.out.println(new String(cipher.encrypt(plainPassword)));
View Full Code Here

  private static final String PLAIN_PWD = "david";
 
    public void testPlainCodec() {
      PasswordCipher cipher = new PlainTextPasswordCipher();
      assertEquals(PLAIN_PWD, new String(cipher.encrypt(PLAIN_PWD)));
      assertEquals(PLAIN_PWD, cipher.decrypt(PLAIN_PWD.toCharArray()));
    }
 
  public void testStaticDesCodec() {
    PasswordCipher cipher = new StaticDESPasswordCipher();
    char[] tmp = cipher.encrypt(PLAIN_PWD);
View Full Code Here

    }
 
  public void testStaticDesCodec() {
    PasswordCipher cipher = new StaticDESPasswordCipher();
    char[] tmp = cipher.encrypt(PLAIN_PWD);
    assertEquals(PLAIN_PWD, cipher.decrypt(tmp));
    }
 
  public void testGetDataSourcePlugin() throws Exception {
        // all current known plugins
        assertPluginClass("PlainText", PlainTextPasswordCipher.class);
View Full Code Here

        } else {
            String password = properties.getProperty("Password");
            if (passwordCipher != null) {
                try {
                    final PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(passwordCipher);
                    final String plainPwd = cipher.decrypt(password.toCharArray());
                    converted.setProperty("password", plainPwd);

                    // all went fine so remove it to avoid errors later
                    properties.remove("PasswordCipher");
                    properties.remove("Password");
View Full Code Here

            }

            // check password codec if available
            if (null != passwordCipher) {
                PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(passwordCipher);
                String plainPwd = cipher.decrypt(password.toCharArray());

                // override previous password value
                super.setPassword(plainPwd);
            }
View Full Code Here

            }

            // check password codec if available
            if (null != passwordCipher) {
                PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(passwordCipher);
                String plainPwd = cipher.decrypt(password.toCharArray());

                // override previous password value
                super.setPassword(plainPwd);
            }
View Full Code Here

        } else {
            String password = properties.getProperty("Password");
            if (passwordCipher != null) {
                try {
                    final PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(passwordCipher);
                    final String plainPwd = cipher.decrypt(password.toCharArray());
                    converted.setProperty("password", plainPwd);

                    // all went fine so remove it to avoid errors later
                    properties.remove("PasswordCipher");
                    properties.remove("Password");
View Full Code Here

        } else {
            String password = properties.getProperty("Password");
            if (passwordCipher != null) {
                try {
                    final PasswordCipher cipher = BasicDataSourceUtil.getPasswordCipher(passwordCipher);
                    final String plainPwd = cipher.decrypt(password.toCharArray());
                    converted.setProperty("password", plainPwd);

                    // all went fine so remove it to avoid errors later
                    properties.remove("PasswordCipher");
                    properties.remove("Password");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.