public class Sasl extends Object
This class defines the policy of how to locate, load, and instantiate SASL clients and servers.
For example, an application or library gets a SASL client by doing something like:
It can then proceed to use the instance to create an authentication connection.SaslClient sc = Sasl.createSaslClient(mechanisms, authorizationId, protocol, serverName, props, callbackHandler);
Similarly, a server gets a SASL server by using code that looks as follows:
SaslServer ss = Sasl.createSaslServer(mechanism, protocol, serverName, props, callbackHandler);
Modifier and Type | Field | Description |
---|---|---|
static String |
BOUND_SERVER_NAME |
The name of a property that specifies the bound server name for
an unbound server.
|
static String |
CREDENTIALS |
The name of a property that specifies the credentials to use.
|
static String |
MAX_BUFFER |
The name of a property that specifies the maximum size of the receive
buffer in bytes of
SaslClient /SaslServer . |
static String |
POLICY_FORWARD_SECRECY |
The name of a property that specifies whether mechanisms that implement
forward secrecy between sessions are required.
|
static String |
POLICY_NOACTIVE |
The name of a property that specifies whether
mechanisms susceptible to active (non-dictionary) attacks
are not permitted.
|
static String |
POLICY_NOANONYMOUS |
The name of a property that specifies whether mechanisms that accept
anonymous login are not permitted.
|
static String |
POLICY_NODICTIONARY |
The name of a property that specifies whether
mechanisms susceptible to passive dictionary attacks are not permitted.
|
static String |
POLICY_NOPLAINTEXT |
The name of a property that specifies
whether mechanisms susceptible to simple plain passive attacks (e.g.,
"PLAIN") are not permitted.
|
static String |
POLICY_PASS_CREDENTIALS |
The name of a property that specifies whether
mechanisms that pass client credentials are required.
|
static String |
QOP |
The name of a property that specifies the quality-of-protection to use.
|
static String |
RAW_SEND_SIZE |
The name of a property that specifies the maximum size of the raw send
buffer in bytes of
SaslClient /SaslServer . |
static String |
REUSE |
The name of a property that specifies whether to reuse previously
authenticated session information.
|
static String |
SERVER_AUTH |
The name of a property that specifies whether the
server must authenticate to the client.
|
static String |
STRENGTH |
The name of a property that specifies the cipher strength to use.
|
Modifier and Type | Method | Description |
---|---|---|
static SaslClient |
createSaslClient(String[] mechanisms,
String authorizationId,
String protocol,
String serverName,
Map<String,?> props,
CallbackHandler cbh) |
Creates a
SaslClient using the parameters supplied. |
static SaslServer |
createSaslServer(String mechanism,
String protocol,
String serverName,
Map<String,?> props,
CallbackHandler cbh) |
Creates a
SaslServer for the specified mechanism. |
static Enumeration<SaslClientFactory> |
getSaslClientFactories() |
Gets an enumeration of known factories for producing
SaslClient . |
static Enumeration<SaslServerFactory> |
getSaslServerFactories() |
Gets an enumeration of known factories for producing
SaslServer . |
public static final String QOP
"auth"
- authentication only"auth-int"
- authentication plus integrity protection"auth-conf"
- authentication plus integrity and confidentiality
protection"auth"
.
The value of this constant is "javax.security.sasl.qop"
.public static final String STRENGTH
"low"
"medium"
"high"
"high,medium,low"
.
The value of this constant is "javax.security.sasl.strength"
.public static final String SERVER_AUTH
"true"
if the server must
authenticate the to client; "false"
otherwise.
The default is "false"
.
"javax.security.sasl.server.authentication"
.public static final String BOUND_SERVER_NAME
serverName
argument in createSaslServer(java.lang.String, java.lang.String, java.lang.String, java.util.Map<java.lang.String, ?>, javax.security.auth.callback.CallbackHandler)
as null.
The property contains the bound host name after the authentication
exchange has completed. It is only available on the server side.
"javax.security.sasl.bound.server.name"
.public static final String MAX_BUFFER
SaslClient
/SaslServer
.
The property contains the string representation of an integer.
"javax.security.sasl.maxbuffer"
.public static final String RAW_SEND_SIZE
SaslClient
/SaslServer
.
The property contains the string representation of an integer.
The value of this property is negotiated between the client and server
during the authentication exchange.
"javax.security.sasl.rawsendsize"
.public static final String REUSE