play.mvc
Class CookieDataCodec

java.lang.Object
  extended by play.mvc.CookieDataCodec

public class CookieDataCodec
extends java.lang.Object

Provides operations around the encoding and decoding of Cookie data.


Constructor Summary
CookieDataCodec()
           
 
Method Summary
static void decode(java.util.Map<java.lang.String,java.lang.String> map, java.lang.String data)
           
static java.lang.String encode(java.util.Map<java.lang.String,java.lang.String> map)
           
static boolean safeEquals(java.lang.String a, java.lang.String b)
          Constant time for same length String comparison, to prevent timing attacks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CookieDataCodec

public CookieDataCodec()
Method Detail

decode

public static void decode(java.util.Map<java.lang.String,java.lang.String> map,
                          java.lang.String data)
                   throws java.io.UnsupportedEncodingException
Parameters:
map - the map to decode data into.
data - the data to decode.
Throws:
java.io.UnsupportedEncodingException

encode

public static java.lang.String encode(java.util.Map<java.lang.String,java.lang.String> map)
                               throws java.io.UnsupportedEncodingException
Parameters:
map - the data to encode.
Returns:
the encoded data.
Throws:
java.io.UnsupportedEncodingException

safeEquals

public static boolean safeEquals(java.lang.String a,
                                 java.lang.String b)
Constant time for same length String comparison, to prevent timing attacks



Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly