Package com.netscape.sasl.mechanisms
Class SaslExternal
java.lang.Object
com.netscape.sasl.mechanisms.SaslExternal
- All Implemented Interfaces:
SaslClient
This class provides the implementation of the EXTERNAL mechanism driver.
This mechanism is passed in the SASL External bind request to retrieve the
current result code from the server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
Retrieves the initial response.byte[]
evaluateChallenge
(byte[] challenge) Evaluates the challenge data and generates a response.Retrieves an input stream for the session.Returns the name of mechanism driver.Retrieves an output stream for the session.boolean
The method may be called at any time to determine if the authentication process is finished.
-
Constructor Details
-
SaslExternal
public SaslExternal()Default constructor
-
-
Method Details
-
createInitialResponse
Retrieves the initial response.- Specified by:
createInitialResponse
in interfaceSaslClient
- Returns:
- The possibly null byte array containing the initial response. It is null if the mechanism does not have an initial response.
- Throws:
SaslException
- If an error occurred while creating the initial response.
-
evaluateChallenge
Evaluates the challenge data and generates a response.- Specified by:
evaluateChallenge
in interfaceSaslClient
- Parameters:
challenge
- The non-null challenge sent from the server.- 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.
- Throws:
SaslException
- If an error occurred while processing the challenge or generating a response.
-
getMechanismName
Returns the name of mechanism driver.- Specified by:
getMechanismName
in interfaceSaslClient
- Returns:
- The mechanism name.
-
isComplete
public boolean isComplete()The method may be called at any time to determine if the authentication process is finished.- Specified by:
isComplete
in interfaceSaslClient
- Returns:
true
if authentication is complete. For this class, always returnstrue
.
-
getInputStream
Retrieves an input stream for the session. It may return the same stream that is passed in, if no processing is to be done by the client object. This method can only be called if isComplete() returns true.- Specified by:
getInputStream
in interfaceSaslClient
- Parameters:
is
- The original input stream for reading from the server.- Returns:
- An input stream for reading from the server, which may include processing the original stream. For this class, the input parameter is always returned.
- Throws:
IOException
- If the authentication exchange has not completed or an error occurred while getting the stream.
-
getOutputStream
Retrieves an output stream for the session. It may return the same stream that is passed in, if no processing is to be done by the client object. This method can only be called if isComplete() returns true.- Specified by:
getOutputStream
in interfaceSaslClient
- Parameters:
os
- The original output stream for writing to the server.- Returns:
- An output stream for writing to the server, which may include processing the original stream. For this class, the input parameter is always returned.
- Throws:
IOException
- If the authentication exchange has not completed or an error occurred while getting the stream.
-