Examples of PasswordCipher


Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher

public class PasswordCodecTest extends TestCase {
 
  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()));
    }
View Full Code Here

Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher

      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);
    assertEquals(PLAIN_PWD, cipher.decrypt(tmp));
    }
View Full Code Here

Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher

        // try the FQN of the target codec
        assertNotNull(BasicDataSourceUtil.getPasswordCipher(PlainTextPasswordCipher.class.getName()));
    }

    private void assertPluginClass(String pluginName, Class<? extends PasswordCipher> pluginClass) throws SQLException {
        PasswordCipher plugin = BasicDataSourceUtil.getPasswordCipher(pluginName);
        assertNotNull(plugin);
        assertSame(pluginClass, plugin.getClass());
    }
View Full Code Here

Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher

            properties.remove("PasswordCipher");
        } 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

Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher

                return super.dataSource;
            }

            // 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

Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher

                return super.dataSource;
            }

            // 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

Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher

            properties.remove("PasswordCipher");
        } 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

Examples of org.apache.openejb.resource.jdbc.cipher.PasswordCipher

            properties.remove("PasswordCipher");
        } 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.