org.mailster.pop3.commands.auth
Class AuthCramCommand

java.lang.Object
  extended by org.mailster.pop3.commands.Pop3Command
      extended by org.mailster.pop3.commands.MultiStatePop3Command
          extended by org.mailster.pop3.commands.auth.AuthAlgorithmCommand
              extended by org.mailster.pop3.commands.auth.AuthCramCommand
Direct Known Subclasses:
AuthCramMD5Command, AuthCramSHA1Command

public abstract class AuthCramCommand
extends AuthAlgorithmCommand

---
Mailster (C) 2007-2009 De Oliveira Edouard

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

See  Mailster Web Site
---

AuthCramCommand.java - An abstract class supporting the POP3 AUTH CRAM command (see RFCs 1734 & 2195). Implementations use different hash functions.

Version:
$Revision: 1.7 $, $Date: 2009/02/03 00:56:00 $
Author:
Edouard De Oliveira

Field Summary
 
Fields inherited from class org.mailster.pop3.commands.auth.AuthAlgorithmCommand
CHECK_RESPONSE_TO_CHALLENGE_STATE
 
Constructor Summary
AuthCramCommand()
           
 
Method Summary
 Pop3CommandState challengeClient(AbstractPop3Handler handler, AbstractPop3Connection conn, java.lang.String cmd)
           
 Pop3CommandState checkClientResponse(AbstractPop3Handler handler, AbstractPop3Connection conn, java.lang.String cmd)
           
abstract  java.lang.String hmacHash(byte[] text, byte[] secret)
           
 boolean isSecuredAuthenticationMethod()
           
 
Methods inherited from class org.mailster.pop3.commands.auth.AuthAlgorithmCommand
execute, isValidForState
 
Methods inherited from class org.mailster.pop3.commands.MultiStatePop3Command
execute
 
Methods inherited from class org.mailster.pop3.commands.Pop3Command
tryLockingMailbox
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthCramCommand

public AuthCramCommand()
Method Detail

hmacHash

public abstract java.lang.String hmacHash(byte[] text,
                                          byte[] secret)
                                   throws java.lang.Exception
Throws:
java.lang.Exception

challengeClient

public Pop3CommandState challengeClient(AbstractPop3Handler handler,
                                        AbstractPop3Connection conn,
                                        java.lang.String cmd)
                                 throws java.io.UnsupportedEncodingException
Specified by:
challengeClient in class AuthAlgorithmCommand
Throws:
java.io.UnsupportedEncodingException

checkClientResponse

public Pop3CommandState checkClientResponse(AbstractPop3Handler handler,
                                            AbstractPop3Connection conn,
                                            java.lang.String cmd)
                                     throws java.lang.Exception
Specified by:
checkClientResponse in class AuthAlgorithmCommand
Throws:
java.lang.Exception

isSecuredAuthenticationMethod

public boolean isSecuredAuthenticationMethod()
Overrides:
isSecuredAuthenticationMethod in class AuthAlgorithmCommand