1   package com.atlassian.seraph.cookie;
2   
3   /**
4    * Encodes and decodes the username and password for remember-me cookies
5    *
6    * @deprecated replaced by the {@link com.atlassian.seraph.service.rememberme.RememberMeService} code
7    */
8   public interface CookieEncoder
9   {
10      /**
11       * Builds a cookie string containing a username and password, using offsets to customise the encoding.
12       * <p>
13       * 
14       * @param username
15       *            The username.
16       * @param password
17       *            The password.
18       * @param encoding
19       *            A String used to customise cookie encoding (only the first 3 characters are used)
20       * @return String encoding the input parameters, an empty string if one of the arguments equals <code>null</code>.
21       */
22      public String encodePasswordCookie(String username, String password, String encoding);
23  
24      /**
25       * Decodes a cookie string containing a username and password.
26       * 
27       * @param cookieVal
28       *            The cookie value.
29       * @param encoding
30       *            A String used to customise cookie encoding (only the first 3 characters are used) - should be the same string you used to encode the
31       *            cookie!
32       * @return String[] containing the username at index 0 and the password at index 1, or <code>{ null, null }</code> if cookieVal equals
33       *         <code>null</code> or the empty string.
34       */
35      public String[] decodePasswordCookie(String cookieVal, String encoding);
36  }