Top Description Fields Constructors Methods
com.sun.security.sasl

pack-priv final Class ExternalClient

extends Object
implements SaslClient
Class Inheritance
All Implemented Interfaces
javax.security.sasl.SaslClient
Imports
javax.security.sasl.*

Implements the EXTERNAL SASL client mechanism. (RFC 2222). The EXTERNAL mechanism returns the optional authorization ID as the initial response. It processes no challenges.
Author
Rosanna Lee

Field Summary

Modifier and TypeField and Description
private boolean
private byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
ExternalClient(String
If non-null, used to specify authorization ID.
authorizationID
)

Constructs an External mechanism with optional authorization ID.

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Implements javax.security.sasl.SaslClient.dispose.

Disposes of any system resources or security-sensitive information the SaslClient might be using.

public byte[]

Returns:

The possible empty initial response.
evaluateChallenge
(byte[]
Ignored.
challengeData
)

Implements javax.security.sasl.SaslClient.evaluateChallenge.

Processes the challenge data.

public String

Returns:

The string "EXTERNAL".
getMechanismName
()

Implements javax.security.sasl.SaslClient.getMechanismName.

Retrieves this mechanism's name for initiating the "EXTERNAL" protocol exchange.

public Object

Returns:

null No property is applicable to this mechanism.
getNegotiatedProperty
(String
The non-null property name.
propName
)

Implements javax.security.sasl.SaslClient.getNegotiatedProperty.

Retrieves the negotiated property.

public boolean
hasInitialResponse()

Implements javax.security.sasl.SaslClient.hasInitialResponse.

This mechanism has an initial response.

public boolean

Returns:

true if initial response has been sent; false otherwise.
isComplete
()

Implements javax.security.sasl.SaslClient.isComplete.

Returns whether this mechanism is complete.

public byte[]
unwrap(byte[]
A non-null byte array containing the encoded bytes from the server.
incoming
,
int
The starting position at incoming of the bytes to use.
offset
,
int
The number of bytes from incoming to use.
len
)

Implements javax.security.sasl.SaslClient.unwrap.

Unwraps the incoming buffer.

public byte[]
wrap(byte[]
A non-null byte array containing the bytes to encode.
outgoing
,
int
The starting position at outgoing of the bytes to use.
offset
,
int
The number of bytes from outgoing to use.
len
)

Implements javax.security.sasl.SaslClient.wrap.

Wraps the outgoing buffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

completedback to summary
private boolean completed
usernameback to summary
private byte[] username

Constructor Detail

ExternalClientback to summary
pack-priv ExternalClient(String authorizationID)

Constructs an External mechanism with optional authorization ID.

Parameters
authorizationID:String

If non-null, used to specify authorization ID.

Method Detail

disposeback to summary
public void dispose() throws SaslException

Implements javax.security.sasl.SaslClient.dispose.

Doc from javax.security.sasl.SaslClient.dispose.

Disposes of any system resources or security-sensitive information the SaslClient might be using. Invoking this method invalidates the SaslClient instance. This method is idempotent.

Exceptions
SaslException:
If a problem was encountered while disposing the resources.
evaluateChallengeback to summary
public byte[] evaluateChallenge(byte[] challengeData)

Implements javax.security.sasl.SaslClient.evaluateChallenge.

Processes the challenge data. It returns the EXTERNAL mechanism's initial response, which is the authorization id encoded in UTF-8. This is the optional information that is sent along with the SASL command. After this method is called, isComplete() returns true.

Parameters
challengeData:byte[]

Ignored.

Returns:byte[]

The possible empty initial response.

Exceptions
IllegalStateException:
If authentication has already been called.
getMechanismNameback to summary
public String getMechanismName()

Implements javax.security.sasl.SaslClient.getMechanismName.

Retrieves this mechanism's name for initiating the "EXTERNAL" protocol exchange.

Returns:String

The string "EXTERNAL".

getNegotiatedPropertyback to summary
public Object getNegotiatedProperty(String propName)

Implements javax.security.sasl.SaslClient.getNegotiatedProperty.

Retrieves the negotiated property. This method can be called only after the authentication exchange has completed (i.e., when isComplete() returns true); otherwise, an IllegalStateException is thrown.

Parameters
propName:String

Doc from javax.security.sasl.SaslClient.getNegotiatedProperty.

The non-null property name.

Returns:Object

null No property is applicable to this mechanism.

Exceptions
IllegalStateException:
if this authentication exchange has not completed
hasInitialResponseback to summary
public boolean hasInitialResponse()

Implements javax.security.sasl.SaslClient.hasInitialResponse.

This mechanism has an initial response.

Returns:boolean

Doc from javax.security.sasl.SaslClient.hasInitialResponse.

true if this mechanism has an initial response.

isCompleteback to summary
public boolean isComplete()

Implements javax.security.sasl.SaslClient.isComplete.

Returns whether this mechanism is complete.

Returns:boolean

true if initial response has been sent; false otherwise.

unwrapback to summary
public byte[] unwrap(byte[] incoming, int offset, int len) throws SaslException

Implements javax.security.sasl.SaslClient.unwrap.

Unwraps the incoming buffer.

Parameters
incoming:byte[]

Doc from javax.security.sasl.SaslClient.unwrap.

A non-null byte array containing the encoded bytes from the server.

offset:int

Doc from javax.security.sasl.SaslClient.unwrap.

The starting position at incoming of the bytes to use.

len:int

Doc from javax.security.sasl.SaslClient.unwrap.

The number of bytes from incoming to use.

Returns:byte[]

Doc from javax.security.sasl.SaslClient.unwrap.

A non-null byte array containing the decoded bytes.

Exceptions
SaslException:
Not applicable to this mechanism.
wrapback to summary
public byte[] wrap(byte[] outgoing, int offset, int len) throws SaslException

Implements javax.security.sasl.SaslClient.wrap.

Wraps the outgoing buffer.

Parameters
outgoing:byte[]

Doc from javax.security.sasl.SaslClient.wrap.

A non-null byte array containing the bytes to encode.

offset:int

Doc from javax.security.sasl.SaslClient.wrap.

The starting position at outgoing of the bytes to use.

len:int

Doc from javax.security.sasl.SaslClient.wrap.

The number of bytes from outgoing to use.

Returns:byte[]

Doc from javax.security.sasl.SaslClient.wrap.

A non-null byte array containing the encoded bytes.

Exceptions
SaslException:
Not applicable to this mechanism.