Determines whether this mechanism has an optional initial response.
If true, caller should call evaluateChallenge() with an
empty array to get the initial response.
Specified by:
hasInitialResponse in interface com.sun.security.sasl.preview.SaslClient
Returns:
true if this mechanism has an initial response.
Always returns true for SSL.
evaluateChallenge
public byte[] evaluateChallenge(byte[] challengeData)
throws com.sun.security.sasl.preview.SaslException
Evaluates the challenge data and generates a response.
Specified by:
evaluateChallenge in interface com.sun.security.sasl.preview.SaslClient
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:
com.sun.security.sasl.preview.SaslException - If an error occurred while processing
the challenge or generating a response.
wrap
public byte[] wrap(byte[] outgoing,
int offset,
int len)
throws com.sun.security.sasl.preview.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; otherwise, a SaslException is thrown.
Returns SSL wrapped byte array.
Specified by:
wrap in interface com.sun.security.sasl.preview.SaslClient
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:
A non-null byte array containing the encoded bytes.
Throws:
com.sun.security.sasl.preview.SaslException - if the authentication exchange has not completed or
if the negotiated quality of protection has neither integrity nor privacy.
unwrap
public byte[] unwrap(byte[] incoming,
int offset,
int len)
throws com.sun.security.sasl.preview.SaslException
Unwraps a byte array received from 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; otherwise, a SaslException is thrown.
Returns SSL unwraped byte array.
Specified by:
unwrap in interface com.sun.security.sasl.preview.SaslClient
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:
A non-null byte array containing the decoded bytes.
Throws:
com.sun.security.sasl.preview.SaslException - if the authentication exchange has not completed or
if the negotiated quality of protection has neither integrity nor privacy.
dispose
public void dispose()
throws com.sun.security.sasl.preview.SaslException
Disposes of the internal I/O streams.
Invoking this method invalidates the SaslClient instance.
Specified by:
dispose in interface com.sun.security.sasl.preview.SaslClient
Throws:
com.sun.security.sasl.preview.SaslException - If a problem was encountered while disposing
the resources.
getNegotiatedProperty
public java.lang.String getNegotiatedProperty(java.lang.String propName)
Retrieves the negotiated property.
This method can be called only after the authentication exchange has
completed (i.e., when isComplete() returns true); otherwise, a
SaslException is thrown.
Specified by:
getNegotiatedProperty in interface com.sun.security.sasl.preview.SaslClient
Returns:
The value of the negotiated property. If null, the property was
not negotiated or is not applicable to this mechanism.
Throws:
com.sun.security.sasl.preview.SaslException - if this authentication exchange has not completed