// Path: classpath-0.98/gnu/javax/crypto/sasl/IAuthInfoProvider.java
// public interface IAuthInfoProvider
// {
//   /**
//    * Activates (initialises) this provider instance. SHOULD be the first method
//    * invoked on the provider.
//    * 
//    * @param context a collection of name-value bindings describing the
//    *          activation context.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   void activate(Map context) throws AuthenticationException;
// 
//   /**
//    * Passivates (releases) this provider instance. SHOULD be the last method
//    * invoked on the provider. Once it is done, no other method may be invoked on
//    * the same instance before it is <i>activated</i> agains.
//    * 
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   void passivate() throws AuthenticationException;
// 
//   /**
//    * Checks if a user with a designated name is known to this provider.
//    * 
//    * @param userName the name of a user to check.
//    * @return <code>true</code> if the user with the designated name is known
//    *         to this provider; <code>false</code> otherwise.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   boolean contains(String userName) throws AuthenticationException;
// 
//   /**
//    * Returns a collection of information about a designated user. The contents
//    * of the returned map is provider-specific of name-to-value mappings.
//    * 
//    * @param userID a map of name-to-value bindings that fully describe a user.
//    * @return a collection of information about the designated user.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   Map lookup(Map userID) throws AuthenticationException;
// 
//   /**
//    * Updates the credentials of a designated user.
//    * 
//    * @param userCredentials a map of name-to-value bindings that fully describe
//    *          a user, including per new credentials.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   void update(Map userCredentials) throws AuthenticationException;
// 
//   /**
//    * A provider may operate in more than mode; e.g. SRP-II caters for user
//    * credentials computed in more than one message digest algorithm. This method
//    * returns the set of name-to-value bindings describing the mode of the
//    * provider.
//    * 
//    * @param mode a unique identifier describing the operational mode.
//    * @return a collection of name-to-value bindings describing the designated
//    *         mode.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   Map getConfiguration(String mode) throws AuthenticationException;
// }
// 
// Path: classpath-0.98/gnu/javax/crypto/sasl/NoSuchUserException.java
// public class NoSuchUserException
//     extends AuthenticationException
// {
//   /** Constructs a <code>NoSuchUserException</code> with no detail message. */
//   public NoSuchUserException()
//   {
//     super();
//   }
// 
//   /**
//    * Constructs a <code>NoSuchUserException</code> with the specified detail
//    * message. In the case of this exception, the detail message designates the
//    * offending username.
//    * 
//    * @param arg the detail message, which in this case is the username.
//    */
//   public NoSuchUserException(String arg)
//   {
//     super(arg);
//   }
// }
// 
// Path: classpath-0.98/javax/security/sasl/AuthenticationException.java
// public class AuthenticationException extends SaslException
// {
// 
//   // Constants and variables
//   // -------------------------------------------------------------------------
// 
//   // Constructor(s)
//   // -------------------------------------------------------------------------
// 
//   /**
//    * Constructs a new instance of <code>AuthenticationException</code>. The
//    * root exception and the detailed message are <code>null</code>.
//    */
//   public AuthenticationException()
//   {
//     super();
//   }
// 
//   /**
//    * Constructs a new instance of <code>AuthenticationException</code> with a
//    * detailed message. The root exception is <code>null</code>.
//    *
//    * @param detail a possibly <code>null</code> string containing details of
//    * the exception.
//    * @see Throwable#getMessage()
//    */
//   public AuthenticationException(String detail)
//   {
//     super(detail);
//   }
// 
//   /**
//    * Constructs a new instance of <code>AuthenticationException</code> with a
//    * detailed message and a root exception.
//    *
//    * @param detail a possibly <code>null</code> string containing details of
//    * the exception.
//    * @param ex a possibly <code>null</code> root exception that caused this
//    * exception.
//    * @see Throwable#getMessage()
//    * @see SaslException#getCause()
//    */
//   public AuthenticationException(String detail, Throwable ex)
//   {
//     super(detail, ex);
//   }
// 
//   // Class methods
//   // -------------------------------------------------------------------------
// 
//   // Instance methods
//   // -------------------------------------------------------------------------
// }


import gnu.java.security.Registry;
import gnu.javax.crypto.sasl.IAuthInfoProvider;
import gnu.javax.crypto.sasl.NoSuchUserException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import gnusasl.javax.security.sasl.AuthenticationException;
  {
    passwordFile = null;
  }

  public boolean contains(String userName) throws AuthenticationException
  {
    if (passwordFile == null)
      throw new AuthenticationException("contains()",
                                        new IllegalStateException());
    boolean result = false;
    try
      {
        result = passwordFile.contains(userName);
      }
    catch (IOException x)
      {
        throw new AuthenticationException("contains()", x);
      }
    return result;
  }

  public Map lookup(Map userID) throws AuthenticationException
  {
    if (passwordFile == null)
      throw new AuthenticationException("lookup()", new IllegalStateException());
    Map result = new HashMap();
    try
      {
        String userName = (String) userID.get(Registry.SASL_USERNAME);
        if (userName == null)
// Path: classpath-0.98/gnu/javax/crypto/sasl/IAuthInfoProvider.java
// public interface IAuthInfoProvider
// {
//   /**
//    * Activates (initialises) this provider instance. SHOULD be the first method
//    * invoked on the provider.
//    * 
//    * @param context a collection of name-value bindings describing the
//    *          activation context.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   void activate(Map context) throws AuthenticationException;
// 
//   /**
//    * Passivates (releases) this provider instance. SHOULD be the last method
//    * invoked on the provider. Once it is done, no other method may be invoked on
//    * the same instance before it is <i>activated</i> agains.
//    * 
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   void passivate() throws AuthenticationException;
// 
//   /**
//    * Checks if a user with a designated name is known to this provider.
//    * 
//    * @param userName the name of a user to check.
//    * @return <code>true</code> if the user with the designated name is known
//    *         to this provider; <code>false</code> otherwise.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   boolean contains(String userName) throws AuthenticationException;
// 
//   /**
//    * Returns a collection of information about a designated user. The contents
//    * of the returned map is provider-specific of name-to-value mappings.
//    * 
//    * @param userID a map of name-to-value bindings that fully describe a user.
//    * @return a collection of information about the designated user.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   Map lookup(Map userID) throws AuthenticationException;
// 
//   /**
//    * Updates the credentials of a designated user.
//    * 
//    * @param userCredentials a map of name-to-value bindings that fully describe
//    *          a user, including per new credentials.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   void update(Map userCredentials) throws AuthenticationException;
// 
//   /**
//    * A provider may operate in more than mode; e.g. SRP-II caters for user
//    * credentials computed in more than one message digest algorithm. This method
//    * returns the set of name-to-value bindings describing the mode of the
//    * provider.
//    * 
//    * @param mode a unique identifier describing the operational mode.
//    * @return a collection of name-to-value bindings describing the designated
//    *         mode.
//    * @throws AuthenticationException if an exception occurs during the
//    *           operation.
//    */
//   Map getConfiguration(String mode) throws AuthenticationException;
// }
// 
// Path: classpath-0.98/gnu/javax/crypto/sasl/NoSuchUserException.java
// public class NoSuchUserException
//     extends AuthenticationException
// {
//   /** Constructs a <code>NoSuchUserException</code> with no detail message. */
//   public NoSuchUserException()
//   {
//     super();
//   }
// 
//   /**
//    * Constructs a <code>NoSuchUserException</code> with the specified detail
//    * message. In the case of this exception, the detail message designates the
//    * offending username.
//    * 
//    * @param arg the detail message, which in this case is the username.
//    */
//   public NoSuchUserException(String arg)
//   {
//     super(arg);
//   }
// }
// 
// Path: classpath-0.98/javax/security/sasl/AuthenticationException.java
// public class AuthenticationException extends SaslException
// {
// 
//   // Constants and variables
//   // -------------------------------------------------------------------------
// 
//   // Constructor(s)
//   // -------------------------------------------------------------------------
// 
//   /**
//    * Constructs a new instance of <code>AuthenticationException</code>. The
//    * root exception and the detailed message are <code>null</code>.
//    */
//   public AuthenticationException()
//   {
//     super();
//   }
// 
//   /**
//    * Constructs a new instance of <code>AuthenticationException</code> with a
//    * detailed message. The root exception is <code>null</code>.
//    *
//    * @param detail a possibly <code>null</code> string containing details of
//    * the exception.
//    * @see Throwable#getMessage()
//    */
//   public AuthenticationException(String detail)
//   {
//     super(detail);
//   }
// 
//   /**
//    * Constructs a new instance of <code>AuthenticationException</code> with a
//    * detailed message and a root exception.
//    *
//    * @param detail a possibly <code>null</code> string containing details of
//    * the exception.
//    * @param ex a possibly <code>null</code> root exception that caused this
//    * exception.
//    * @see Throwable#getMessage()
//    * @see SaslException#getCause()
//    */
//   public AuthenticationException(String detail, Throwable ex)
//   {
//     super(detail, ex);
//   }
// 
//   // Class methods
//   // -------------------------------------------------------------------------
// 
//   // Instance methods
//   // -------------------------------------------------------------------------
// }


// Path: classpath-0.98/gnu/javax/crypto/sasl/crammd5/CramMD5AuthInfoProvider.java
import gnu.java.security.Registry;
import gnu.javax.crypto.sasl.IAuthInfoProvider;
import gnu.javax.crypto.sasl.NoSuchUserException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import gnusasl.javax.security.sasl.AuthenticationException;

  {
    passwordFile = null;
  }

  public boolean contains(String userName) throws AuthenticationException
  {
    if (passwordFile == null)
      throw new AuthenticationException("contains()",
                                        new IllegalStateException());
    boolean result = false;
    try
      {
        result = passwordFile.contains(userName);
      }
    catch (IOException x)
      {
        throw new AuthenticationException("contains()", x);
      }
    return result;
  }

  public Map lookup(Map userID) throws AuthenticationException
  {
    if (passwordFile == null)
      throw new AuthenticationException("lookup()", new IllegalStateException());
    Map result = new HashMap();
    try
      {
        String userName = (String) userID.get(Registry.SASL_USERNAME);
        if (userName == null)
          throw new NoSuchUserException("");