All LDAP Classes
Internal LDAP Classes

com.novell.sasl
Interface SaslClient

All Known Implementing Classes:
DigestMD5SaslClient, ExternalSaslClient

public interface SaslClient

Performs SASL authentication as a client.An Class implementing this interface can negotiate authentication as a client using one of the IANA-registered mechanisms.

See Also:
Sasl, SaslClientFactory

Method Summary
 void dispose()
          Disposes of any system resources or security-sensitive information the SaslClient might be using.
 byte[] evaluateChallenge(byte[] challenge)
          If a challenge is received from the server during the authentication process, this method is called to prepare an appropriate next response to submit to the server.
 java.lang.String getMechanismName()
          Reports the IANA-registered name of the mechanism used by this client, e.g.
 java.lang.Object getNegotiatedProperty(java.lang.String propName)
          This method Retrieves the negotiated property.
 boolean hasInitialResponse()
          Determines whether this mechanism has an optional initial response.
 boolean isComplete()
          This method may be called at any time to determine if the authentication process is finished.
 byte[] unwrap(byte[] incoming, int offset, int len)
          Unwraps a byte array received from the server This method can be called only after the authentication process has completed (i.e., when isComplete() returns true) and only if the authentication process has negotiated integrity and/or privacy as the quality of protection.
 byte[] wrap(byte[] outgoing, int offset, int len)
          Wraps a byte array to be sent to the server This method can be called only after the authentication exchange has completed (i.e., when isComplete() returns true) and only if the authentication exchange has negotiated integrity and/or privacy as the quality of protection.
 

Method Detail

getMechanismName

public java.lang.String getMechanismName()
Reports the IANA-registered name of the mechanism used by this client, e.g. "NMAS_LOGIN" or "DIGEST-MD5".

Returns:
A non-null string representing the IANA-registered mechanism name.

hasInitialResponse

public boolean hasInitialResponse()
Determines whether this mechanism has an optional initial response. If true, caller should call evaluateChallenge() with an empty array to get the initial response.

Returns:
true if this mechanism has an initial response

evaluateChallenge

public byte[] evaluateChallenge(byte[] challenge)
                         throws SaslException
If a challenge is received from the server during the authentication process, this method is called to prepare an appropriate next response to submit to the server.

Parameters:
challenge - The non-null challenge received from the server. The challenge array may have zero length.
Returns:
The possibly null reponse to send to the server. It is null if the challenge accompanied a "SUCCESS" status and the challenge only contains data for the client to update its state and no response needs to be sent to the server. The response is a zero-length byte array if the client is to send a response with no data.
Throws:
SaslException - If an error occurred while processing the challenge or generating a response.

isComplete

public boolean isComplete()
This method may be called at any time to determine if the authentication process is finished.

Returns:
  • true - If the authentication exchange has completed
  • false - otherwise

unwrap

public byte[] unwrap(byte[] incoming,
                     int offset,
                     int len)
              throws SaslException
Unwraps a byte array received from the server This method can be called only after the authentication process has completed (i.e., when isComplete() returns true) and only if the authentication process has negotiated integrity and/or privacy as the quality of protection.

Parameters:
incoming - A non-null byte array containing the encoded bytes from the server.
offset - The starting position at incoming of the bytes to use
len - The number of bytes from incoming to use.
Returns:
The corresponding decoded bytes in a byte array.
Throws:
SaslException - If this method is called before the authentictaion process has completed.A SaslException is thrown also if incoming cannot be successfully unwrapped

wrap

public byte[] wrap(byte[] outgoing,
                   int offset,
                   int len)
            throws SaslException
Wraps a byte array to be sent to the server This method can be called only after the authentication exchange has completed (i.e., when isComplete() returns true) and only if the authentication exchange has negotiated integrity and/or privacy as the quality of protection.

Parameters:
outgoing - A non-null byte array containing the bytes to encode.
offset - The starting position at outgoing of the bytes to use.
len - The number of bytes from outgoing to use.
Returns:
The corresponding encoded bytes in a byte array.
Throws:
SaslException - If this method is called before the authentictaion exchange has completed.A SaslException is thrown also if outgoing cannot be successfully wrapped.

getNegotiatedProperty

public java.lang.Object getNegotiatedProperty(java.lang.String propName)
                                       throws SaslException
This method Retrieves the negotiated property.

This method can be called only after the authentication exchange has completed (i.e., when isComplete() returns true)

For example, this method may be used to obtained the negotiated raw send buffer size, quality-of-protection, and cipher strength.

Parameters:
propName - The non-null property name.
Returns:
The value of the negotiated property. If null, the property was not negotiated or is not applicable to this mechanism.
Throws:
java.lang.IllegalStateException - if this authentication exchange has not completed
SaslException

dispose

public void dispose()
             throws SaslException
Disposes of any system resources or security-sensitive information the SaslClient might be using. Invoking this method invalidates the SaslClient instance. This method is idempotent.

Throws:
SaslException - If a problem was encountered while disposing of the resources

All LDAP Classes
Internal LDAP Classes

Copyright © 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000