com.atlassian.seraph.cookie
Class InsecureCookieEncoder

java.lang.Object
  extended by com.atlassian.seraph.cookie.InsecureCookieEncoder
All Implemented Interfaces:
CookieEncoder

Deprecated. replaced by the RememberMeService code

public class InsecureCookieEncoder
extends Object
implements CookieEncoder

Insecure cooking encoder that uses an XOR mask with character offsets to "encode" the username and password


Constructor Summary
InsecureCookieEncoder()
          Deprecated.  
 
Method Summary
 String[] decodePasswordCookie(String cookieVal)
          Deprecated. only here to support CookieUtils.decodePasswordCookie(String)
 String[] decodePasswordCookie(String cookieVal, String encoding)
          Deprecated. Decodes a cookie string containing a username and password.
 String encodePasswordCookie(String username, String password)
          Deprecated. only here to support CookieUtils.encodePasswordCookie(String, String)
 String encodePasswordCookie(String username, String password, String encoding)
          Deprecated. Builds a cookie string containing a username and password, using offsets to customise the encoding.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InsecureCookieEncoder

public InsecureCookieEncoder()
Deprecated. 
Method Detail

encodePasswordCookie

public String encodePasswordCookie(String username,
                                   String password,
                                   String encoding)
Deprecated. 
Description copied from interface: CookieEncoder
Builds a cookie string containing a username and password, using offsets to customise the encoding.

Specified by:
encodePasswordCookie in interface CookieEncoder
Parameters:
username - The username.
password - The password.
encoding - A String used to customise cookie encoding (only the first 3 characters are used)
Returns:
String encoding the input parameters, an empty string if one of the arguments equals null.

decodePasswordCookie

public String[] decodePasswordCookie(String cookieVal,
                                     String encoding)
Deprecated. 
Description copied from interface: CookieEncoder
Decodes a cookie string containing a username and password.

Specified by:
decodePasswordCookie in interface CookieEncoder
Parameters:
cookieVal - The cookie value.
encoding - A String used to customise cookie encoding (only the first 3 characters are used) - should be the same string you used to encode the cookie!
Returns:
String[] containing the username at index 0 and the password at index 1, or { null, null } if cookieVal equals null or the empty string.

encodePasswordCookie

public String encodePasswordCookie(String username,
                                   String password)
Deprecated. only here to support CookieUtils.encodePasswordCookie(String, String)

Builds a cookie string containing a username and password.

Note: with open source this is not really secure, but it prevents users from snooping the cookie file of others and by changing the XOR mask and character offsets, you can easily tweak results.

Parameters:
username - The username.
password - The password.
Returns:
String encoding the input parameters, an empty string if one of the arguments equals null.

decodePasswordCookie

public String[] decodePasswordCookie(String cookieVal)
Deprecated. only here to support CookieUtils.decodePasswordCookie(String)

Decodes a cookie string containing a username and password.

Parameters:
cookieVal - The cookie value.
Returns:
String[] containing the username at index 0 and the password at index 1, or { null, null } if cookieVal equals null or the empty string.


Copyright © 2013 Atlassian. All Rights Reserved.