public class ClearspaceSaslServer extends Object implements SaslServer
Constructor and Description |
---|
ClearspaceSaslServer() |
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Disposes of any system resources or security-sensitive information
the SaslServer might be using.
|
byte[] |
evaluateResponse(byte[] response)
Evaluates the response data and generates a challenge.
|
String |
getAuthorizationID()
Reports the authorization ID in effect for the client of this
session.
|
String |
getMechanismName()
Returns the mechanism name of this SASL server.
|
Object |
getNegotiatedProperty(String propName)
Retrieves the negotiated property.
|
boolean |
isComplete()
Determines whether the authentication exchange has completed.
|
byte[] |
unwrap(byte[] incoming,
int offset,
int len)
Unwraps a byte array received from the client.
|
byte[] |
wrap(byte[] outgoing,
int offset,
int len)
Wraps a byte array to be sent to the client.
|
public String getMechanismName()
getMechanismName
in interface SaslServer
public byte[] evaluateResponse(byte[] response) throws SaslException
If a response is received from the client during the authentication process, this method is called to prepare an appropriate next challenge to submit to the client. The challenge is null if the authentication has succeeded and no more challenge data is to be sent to the client. It is non-null if the authentication must be continued by sending a challenge to the client, or if the authentication has succeeded but challenge data needs to be processed by the client. isComplete() should be called after each call to evaluateResponse(),to determine if any further response is needed from the client.
evaluateResponse
in interface SaslServer
response
- The non-null (but possibly empty) response sent
by the client.SaslException
- If an error occurred while processing
the response or generating a challenge.public boolean isComplete()
isComplete
in interface SaslServer
public String getAuthorizationID()
getAuthorizationID
in interface SaslServer
IllegalStateException
- if this authentication session has not completedpublic byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException
incoming is the contents of the SASL buffer as defined in RFC 2222 without the leading four octet field that represents the length. offset and len specify the portion of incoming to use.
unwrap
in interface SaslServer
incoming
- A non-null byte array containing the encoded bytes
from the client.offset
- The starting position at incoming of the bytes to use.len
- The number of bytes from incoming to use.SaslException
- if incoming cannot be successfully
unwrapped.IllegalStateException
- if the authentication exchange has
not completed, or if the negotiated quality of protection
has neither integrity nor privacypublic byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException
The result of this method will make up the contents of the SASL buffer as defined in RFC 2222 without the leading four octet field that represents the length. offset and len specify the portion of outgoing to use.
wrap
in interface SaslServer
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.SaslException
- if outgoing cannot be successfully
wrapped.IllegalStateException
- if the authentication exchange has
not completed, or if the negotiated quality of protection has
neither integrity nor privacy.public Object getNegotiatedProperty(String propName)
getNegotiatedProperty
in interface SaslServer
propName
- the propertyIllegalStateException
- if this authentication exchange has not completedpublic void dispose() throws SaslException
dispose
in interface SaslServer
SaslException
- If a problem was encountered while disposing
the resources.Copyright © 2003-2008 Jive Software.