Search in sources :

Example 1 with NoCrypt

use of org.apache.wicket.util.crypt.NoCrypt in project wicket by apache.

the class CryptTest method noCrypt.

/**
 */
@Test
public void noCrypt() {
    // The NoCrypt implementation does not modify the string at all
    final ICrypt crypt = new NoCrypt();
    assertEquals("test", crypt.encryptUrlSafe("test"));
    assertEquals("test", crypt.decryptUrlSafe("test"));
}
Also used : ICrypt(org.apache.wicket.util.crypt.ICrypt) NoCrypt(org.apache.wicket.util.crypt.NoCrypt) Test(org.junit.Test)

Example 2 with NoCrypt

use of org.apache.wicket.util.crypt.NoCrypt in project wicket by apache.

the class WicketExampleApplication method init.

@Override
protected void init() {
    // WARNING: DO NOT do this on a real world application unless
    // you really want your app's passwords all passed around and
    // stored in unencrypted browser cookies (BAD IDEA!)!!!
    // The NoCrypt class is being used here because not everyone
    // has the java security classes required by Crypt installed
    // and we want them to be able to run the examples out of the
    // box.
    getSecuritySettings().setCryptFactory(new ClassCryptFactory(NoCrypt.class, SecuritySettings.DEFAULT_ENCRYPTION_KEY));
    getDebugSettings().setDevelopmentUtilitiesEnabled(true);
    getResourceSettings().setCssCompressor(new CssUrlReplacer());
}
Also used : CssUrlReplacer(org.apache.wicket.resource.CssUrlReplacer) NoCrypt(org.apache.wicket.util.crypt.NoCrypt) ClassCryptFactory(org.apache.wicket.util.crypt.ClassCryptFactory)

Aggregations

NoCrypt (org.apache.wicket.util.crypt.NoCrypt)2 CssUrlReplacer (org.apache.wicket.resource.CssUrlReplacer)1 ClassCryptFactory (org.apache.wicket.util.crypt.ClassCryptFactory)1 ICrypt (org.apache.wicket.util.crypt.ICrypt)1 Test (org.junit.Test)1