APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.security.sasl

public final Class ClientFactoryImpl

extends Object
implements SaslClientFactory
Class Inheritance
All Implemented Interfaces
javax.security.sasl.SaslClientFactory
Imports
javax.security.sasl.*, com.sun.security.sasl.util.PolicyUtils, java.util.Map, java.io.IOException, javax.security.auth.callback.Callback, .CallbackHandler, .NameCallback, .PasswordCallback, .UnsupportedCallbackException

Client factory for EXTERNAL, CRAM-MD5, PLAIN. Requires the following callbacks to be satisfied by callback handler when using CRAM-MD5 or PLAIN. - NameCallback (to get username) - PasswordCallback (to get password)
Author
Rosanna Lee

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int[]
private static final String[]
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public SaslClient
createSaslClient(String[] mechs, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh)

Implements javax.security.sasl.SaslClientFactory.createSaslClient.

Creates a SaslClient using the parameters supplied.

public String[]
getMechanismNames(Map<String, ?> props)

Implements javax.security.sasl.SaslClientFactory.getMechanismNames.

Returns an array of names of mechanisms that match the specified mechanism selection policies.

private Object[]

Returns:

an {authid, passwd} pair
getUserInfo
(String
The non-null prefix to use for the prompt (e.g., mechanism name)
prefix
,
String
The possibly null authorization id. This is used as a default for the NameCallback. If null, it is not used in prompt.
authorizationId
,
CallbackHandler
The non-null callback handler to use.
cbh
)

Gets the authentication id and password.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

CRAMMD5back to summary
private static final int CRAMMD5
EXTERNALback to summary
private static final int EXTERNAL
mechPoliciesback to summary
private static final int[] mechPolicies
myMechsback to summary
private static final String[] myMechs
PLAINback to summary
private static final int PLAIN

Constructor Detail

ClientFactoryImplback to summary
public ClientFactoryImpl()

Method Detail

createSaslClientback to summary
public SaslClient createSaslClient(String[] mechs, String authorizationId, String protocol, String serverName, Map<String, ?> props, CallbackHandler cbh) throws SaslException

Implements javax.security.sasl.SaslClientFactory.createSaslClient.

Doc from javax.security.sasl.SaslClientFactory.createSaslClient.

Creates a SaslClient using the parameters supplied.

Exceptions
SaslException:
If cannot create a SaslClient because of an error.
getMechanismNamesback to summary
public String[] getMechanismNames(Map<String, ?> props)

Implements javax.security.sasl.SaslClientFactory.getMechanismNames.

Doc from javax.security.sasl.SaslClientFactory.getMechanismNames.

Returns an array of names of mechanisms that match the specified mechanism selection policies.

getUserInfoback to summary
private Object[] getUserInfo(String prefix, String authorizationId, CallbackHandler cbh) throws SaslException

Gets the authentication id and password. The password is converted to bytes using UTF-8 and stored in bytepw. The authentication id is stored in authId.

Parameters
prefix:String

The non-null prefix to use for the prompt (e.g., mechanism name)

authorizationId:String

The possibly null authorization id. This is used as a default for the NameCallback. If null, it is not used in prompt.

cbh:CallbackHandler

The non-null callback handler to use.

Returns:Object[]

an {authid, passwd} pair