org.appfuse.util
Class StringUtil

java.lang.Object
  extended by org.appfuse.util.StringUtil

public class StringUtil
extends Object

String Utility Class This is used to encode passwords programmatically

View Source

Author:
Matt Raible

Constructor Summary
StringUtil()
           
 
Method Summary
static String decodeString(String str)
          Decode a string using Base64 encoding.
static String encodePassword(String password, String algorithm)
          Encode a string using algorithm specified in web.xml and return the resulting encrypted password.
static String encodeString(String str)
          Encode a string using Base64 encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

encodePassword

public static String encodePassword(String password,
                                    String algorithm)
Encode a string using algorithm specified in web.xml and return the resulting encrypted password. If exception, the plain credentials string is returned

Parameters:
password - Password or other credentials to use in authenticating this username
algorithm - Algorithm used to do the digest
Returns:
encypted password based on the algorithm.

encodeString

public static String encodeString(String str)
Encode a string using Base64 encoding. Used when storing passwords as cookies. This is weak encoding in that anyone can use the decodeString routine to reverse the encoding.

Parameters:
str -
Returns:
String

decodeString

public static String decodeString(String str)
Decode a string using Base64 encoding.

Parameters:
str -
Returns:
String


Copyright � 2002-2006