org.jboss.sasl.util
Class AbstractSaslClient
java.lang.Object
org.jboss.sasl.util.AbstractSaslParticipant
org.jboss.sasl.util.AbstractSaslClient
- All Implemented Interfaces:
- SaslClient
- Direct Known Subclasses:
- AnonymousSaslClient, ClientTokenSaslClient
public abstract class AbstractSaslClient
- extends AbstractSaslParticipant
- implements SaslClient
A base class for SASL client implementations.
- Author:
- David M. Lloyd
Methods inherited from class org.jboss.sasl.util.AbstractSaslParticipant |
dispose, getCallbackHandler, getContext, getMechanismName, getNegotiatedProperty, getProtocol, getServerName, getWrapper, handleCallbacks, isComplete, setWrapper, tryHandleCallbacks, unwrap, wrap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractSaslClient
protected AbstractSaslClient(String mechanismName,
String protocol,
String serverName,
CallbackHandler callbackHandler,
String authorizationId,
boolean hasInitialResponse)
- Construct a new instance.
- Parameters:
mechanismName
- the SASL mechanism nameprotocol
- the protocolserverName
- the server namecallbackHandler
- the callback handler to use for authenticationauthorizationId
- the possibly null
protocol-dependent name used for authorizationhasInitialResponse
- true
if the mechanism supports an initial response, false
otherwise
evaluateChallenge
public byte[] evaluateChallenge(byte[] challenge)
throws SaslException
- Evaluate an authentication challenge received from the server.
- Specified by:
evaluateChallenge
in interface SaslClient
- Parameters:
challenge
- the authentication challenge
- Returns:
- the response to send to the server
- Throws:
SaslException
- if there is an error processing the server message
hasInitialResponse
public boolean hasInitialResponse()
- Determines whether this mechanism has an optional initial response.
If true, caller should call
evaluateChallenge(byte[])
with an
empty array to get the initial response.
- Specified by:
hasInitialResponse
in interface SaslClient
- Returns:
true
if this mechanism has an initial response
getAuthorizationId
protected String getAuthorizationId()
- Get the specified authorization ID.
- Returns:
- the authorization ID
Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.