org.jasypt.wicket
Class JasyptCrypt

Object
  extended by org.jasypt.wicket.JasyptCrypt
All Implemented Interfaces:
org.apache.wicket.util.crypt.ICrypt

public final class JasyptCrypt
extends Object
implements org.apache.wicket.util.crypt.ICrypt

Jasypt's implementation of ICrypt, based on the use of a PBEByteEncryptor object for encryption and decryption operations.

This class is thread-safe.

Since:
1.4
Author:
Daniel Fernández

Constructor Summary
JasyptCrypt(PBEByteEncryptor encryptor)
           Creates a new JasyptCrypt object, wrapping the passed encryptor.
 
Method Summary
 String decryptUrlSafe(String text)
           Decrypts a string using URL and filename safe Base64 decoding.
 String encryptUrlSafe(String plainText)
           Encrypts a string using URL and filename safe Base64 encoding.
 void setKey(String key)
           Important: Using jasypt, it makes no sense to change the encryption key once the encryptor has been initialized, and so this method is implemented to throw UnsupportedOperationException always.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JasyptCrypt

public JasyptCrypt(PBEByteEncryptor encryptor)

Creates a new JasyptCrypt object, wrapping the passed encryptor.

Parameters:
encryptor - the PBEByteEncryptor to be used internally.
Method Detail

decryptUrlSafe

public String decryptUrlSafe(String text)

Decrypts a string using URL and filename safe Base64 decoding.

Specified by:
decryptUrlSafe in interface org.apache.wicket.util.crypt.ICrypt
Parameters:
text - the text to be decrypted.
Returns:
the decrypted string.

encryptUrlSafe

public String encryptUrlSafe(String plainText)

Encrypts a string using URL and filename safe Base64 encoding.

Specified by:
encryptUrlSafe in interface org.apache.wicket.util.crypt.ICrypt
Parameters:
plainText - the text to be encrypted.
Returns:
encrypted string.

setKey

public void setKey(String key)

Important: Using jasypt, it makes no sense to change the encryption key once the encryptor has been initialized, and so this method is implemented to throw UnsupportedOperationException always.

Specified by:
setKey in interface org.apache.wicket.util.crypt.ICrypt


Copyright © 2011 The JASYPT team. All Rights Reserved.