Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.gisgraphy.util
Class StringUtil

    java.lang.Object
      com.gisgraphy.util.StringUtil

    public final class StringUtil

extends Object

String Utility Class This is used to encode passwords programmatically

Author:
  Matt Raible

Method Summary
`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`

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` - the string to encode
  Returns:
    the encoded string

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012. All Rights Reserved.