org.mentawai.cript
Class MentaCript

java.lang.Object
  extended by org.mentawai.cript.MentaCript

public class MentaCript
extends Object

Class that cript end decript values. EX: MentaCript.cript("123") // returns DtdvnYls4L4= MentaCript.decript("DtdvnYls4L4=") // returns 123

Author:
Robert Willian Gil

Field Summary
static String PREFIX_CRIPT_TAG
           
 
Method Summary
static void changeCommonKey(String key)
           
 String cript(Integer n)
           
 String cript(String v)
           
static String cript(String v, SessionContext session)
          Used for taglib funcion
 String decript(String v)
           
 String decript(String v, SessionContext session)
          Used for taglib funcion
 Integer decriptToInt(String v)
           
static MentaCript getCommonInstance()
          This return a common MentaCript instance, if you want to send the hash to somebody in email or etc, you may want to decode with the same pass phrase later.
static MentaCript getInstance(javax.servlet.http.HttpSession httpSession)
          Return one instance per session with its own pass phrase.
static MentaCript getInstance(SessionContext sessionContext)
          Return one instance per session with its own pass phrase.
 void setPassPhrase(String newPassPhrase)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREFIX_CRIPT_TAG

public static final String PREFIX_CRIPT_TAG
See Also:
Constant Field Values
Method Detail

changeCommonKey

public static void changeCommonKey(String key)

getCommonInstance

public static MentaCript getCommonInstance()
This return a common MentaCript instance, if you want to send the hash to somebody in email or etc, you may want to decode with the same pass phrase later.


getInstance

public static MentaCript getInstance(SessionContext sessionContext)
Return one instance per session with its own pass phrase.

Parameters:
sessionContext - the session context
Returns:
MentaCript instance

getInstance

public static MentaCript getInstance(javax.servlet.http.HttpSession httpSession)
Return one instance per session with its own pass phrase.

Parameters:
httpSession - the http session
Returns:
MentaCript instance

setPassPhrase

public void setPassPhrase(String newPassPhrase)

cript

public String cript(Integer n)

cript

public String cript(String v)

decript

public String decript(String v)
               throws DecriptException
Throws:
DecriptException

decriptToInt

public Integer decriptToInt(String v)

cript

public static String cript(String v,
                           SessionContext session)
Used for taglib funcion

Parameters:
v -
session -
Returns:
cripted value

decript

public String decript(String v,
                      SessionContext session)
               throws DecriptException
Used for taglib funcion

Parameters:
v -
session -
Returns:
decripted value
Throws:
DecriptException - if not enable to decript


Copyright © 2013. All Rights Reserved.