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

pack-priv final Class CramMD5Client

extends CramMD5Base
implements SaslClient
Class Inheritance
All Implemented Interfaces
javax.security.sasl.SaslClient
Imports
javax.security.sasl.*, java.security.NoSuchAlgorithmException, java.util.logging.Logger, .Level

Implements the CRAM-MD5 SASL client-side mechanism. (RFC 2195). CRAM-MD5 has no initial response. It receives bytes from the server as a challenge, which it hashes by using MD5 and the password. It concatenates the authentication ID with this result and returns it as the response to the challenge. At that point, the exchange is complete.
Authors
Vincent Ryan, Rosanna Lee

Field Summary

Modifier and TypeField and Description
private String
Inherited from com.sun.security.sasl.CramMD5Base:
abortedcompletedloggerpw

Constructor Summary

AccessConstructor and Description
pack-priv
CramMD5Client(String
A non-null string representing the principal being authenticated.
authID
,
byte[]
A non-null String or byte[] containing the password. If it is an array, it is first cloned.
pw
)

Creates a SASL mechanism with client credentials that it needs to participate in CRAM-MD5 authentication exchange with the server.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

A non-null byte array containing the response to be sent to the server.
evaluateChallenge
(byte[]
A non-null byte array containing the challenge data from the server.
challengeData
)

Implements javax.security.sasl.SaslClient.evaluateChallenge.

Processes the challenge data.

public boolean
hasInitialResponse()

Implements javax.security.sasl.SaslClient.hasInitialResponse.

CRAM-MD5 has no initial response.

Inherited from com.sun.security.sasl.CramMD5Base:
clearPassworddisposefinalizegetMechanismNamegetNegotiatedPropertyHMAC_MD5isCompleteunwrapwrap

Field Detail

usernameback to summary
private String username

Constructor Detail

CramMD5Clientback to summary
pack-priv CramMD5Client(String authID, byte[] pw) throws SaslException

Creates a SASL mechanism with client credentials that it needs to participate in CRAM-MD5 authentication exchange with the server.

Parameters
authID:String

A non-null string representing the principal being authenticated.

pw:byte[]

A non-null String or byte[] containing the password. If it is an array, it is first cloned.

Method Detail

evaluateChallengeback to summary
public byte[] evaluateChallenge(byte[] challengeData) throws SaslException

Implements javax.security.sasl.SaslClient.evaluateChallenge.

Processes the challenge data. The server sends a challenge data using which the client must compute an MD5-digest with its password as the key.

Parameters
challengeData:byte[]

A non-null byte array containing the challenge data from the server.

Returns:byte[]

A non-null byte array containing the response to be sent to the server.

Exceptions
SaslException:
if platform does not have MD5 support
IllegalStateException:
if this method is invoked more than once.
hasInitialResponseback to summary
public boolean hasInitialResponse()

Implements javax.security.sasl.SaslClient.hasInitialResponse.

CRAM-MD5 has no initial response.