com.netscape.sasl.mechanisms
Class SaslExternal
java.lang.Object
com.netscape.sasl.mechanisms.SaslExternal
- SaslClient
public class SaslExternal
extends java.lang.Object
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.
byte[] | createInitialResponse() - Retrieves the initial response.
|
byte[] | evaluateChallenge(byte[] challenge) - Evaluates the challenge data and generates a response.
|
InputStream | getInputStream(InputStream is) - Retrieves an input stream for the session.
|
String | getMechanismName() - Returns the name of mechanism driver.
|
OutputStream | getOutputStream(OutputStream os) - Retrieves an output stream for the session.
|
boolean | isComplete() - The method may be called at any time to determine if the authentication
process is finished.
|
SaslExternal
public SaslExternal()
Default constructor
createInitialResponse
public byte[] createInitialResponse()
throws SaslException
Retrieves the initial response.
- createInitialResponse in interface SaslClient
- The possibly null byte array containing the initial response.
It is null if the mechanism does not have an initial response.
SaslException
- If an error occurred while creating
the initial response.
evaluateChallenge
public byte[] evaluateChallenge(byte[] challenge)
throws SaslException
Evaluates the challenge data and generates a response.
- evaluateChallenge in interface SaslClient
challenge
- The non-null challenge sent from the server.
- 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.
SaslException
- If an error occurred while processing
the challenge or generating a response.
getInputStream
public InputStream getInputStream(InputStream is)
throws IOException
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.
- getInputStream in interface SaslClient
is
- The original input stream for reading from the server.
- An input stream for reading from the server, which
may include processing the original stream. For this class, the
input parameter is always returned.
getOutputStream
public OutputStream getOutputStream(OutputStream os)
throws IOException
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.
- getOutputStream in interface SaslClient
os
- The original output stream for writing to the server.
- An output stream for writing to the server, which
may include processing the original stream. For this class, the
input parameter is always returned.
isComplete
public boolean isComplete()
The method may be called at any time to determine if the authentication
process is finished.
- isComplete in interface SaslClient
true
if authentication is complete. For this class,
always returns true
.