use of org.apache.openejb.cipher.StaticDESPasswordCipher in project tomee by apache.
the class PasswordCodecTest method testStaticDesCodec.
public void testStaticDesCodec() {
final PasswordCipher cipher = new StaticDESPasswordCipher();
final char[] tmp = cipher.encrypt(PLAIN_PWD);
assertEquals(PLAIN_PWD, cipher.decrypt(tmp));
}
use of org.apache.openejb.cipher.StaticDESPasswordCipher in project tomee by apache.
the class ClientContextCipheringTest method customCipher.
@Test
public void customCipher() throws NamingException {
final JNDIContext jndiContext = new JNDIContext();
final Hashtable<String, Object> env = new Hashtable<>();
env.put(Context.PROVIDER_URL, "cipher:Static3DES:" + String.valueOf(new StaticDESPasswordCipher().encrypt("ejbd://localhost:1234")));
jndiContext.getInitialContext(env);
Assert.assertEquals("ejbd://localhost:1234", jndiContext.getEnvironment().get(Context.PROVIDER_URL).toString());
}
Aggregations