Class ClientFactory

java.lang.Object
com.netscape.sasl.ClientFactory
All Implemented Interfaces:
SaslClientFactory

public class ClientFactory extends Object implements SaslClientFactory
An interface for creating instances of SaslClient.
See Also:
  • Constructor Details

    • ClientFactory

      public ClientFactory()
  • Method Details

    • createSaslClient

      public SaslClient createSaslClient(String[] mechanisms, String authorizationId, String protocol, String serverName, Hashtable<Object,Object> props, CallbackHandler cbh) throws SaslException
      Creates a SaslClient using the parameters supplied.
      Specified by:
      createSaslClient in interface SaslClientFactory
      Parameters:
      mechanisms - The non-null list of mechanism names to try. Each is the IANA-registered name of a SASL mechanism. (e.g. "GSSAPI", "CRAM-MD5").
      authorizationId - The possibly null authorization ID to use. When the SASL authentication completes successfully, the entity named by authorizationId is granted access.
      protocol - The non-null string name of the protocol for which the authentication is being performed (e.g., "ldap").
      serverName - The non-null string name of the server to which we are creating an authenticated connection.
      props - The possibly null properties to be used by the SASL mechanisms to configure the authentication exchange. For example, "javax.security.sasl.encryption.maximum" might be used to specify the maximum key length to use for encryption.
      cbh - The possibly null callback handler to used by the SASL mechanisms to get further information from the application/library to complete the authentication. For example, a SASL mechanism might require the authentication ID and password from the caller.
      Returns:
      A possibly null SaslClient created using the parameters supplied. If null, this factory cannot produce a SaslClient using the parameters supplied.
      Throws:
      SaslException - if it cannot create a SaslClient because of an error.
    • getMechanismNames

      public String[] getMechanismNames()
      Returns an array of names of mechanisms supported by this factory.
      Specified by:
      getMechanismNames in interface SaslClientFactory
      Returns:
      A non-null array containing IANA-registered SASL mechanism names.