Package com.isode.som
Class SomScramSha1Client
java.lang.Object
com.isode.som.SomScramSha1Client
- All Implemented Interfaces:
SaslClient
Class which implements a SCRAM-SHA-1 SASL client, in line with the
requirements of javax.security.sasl. The code uses the
SCRAMSHA1ClientAuthenticator class from the Stroke package to
handle the challenge/response generation etc.
Note that the wrap and unwrap methods of this class have not
been implemented yet: they are not required for the SOM API's
use of SASL.
The NameCallback and PasswordCallback are used to obtain the
authentication id and password respectively.
- Since:
- 16.1
- Author:
- tc
-
Constructor Summary
ConstructorsConstructorDescriptionSomScramSha1Client
(String authzid, String protocol, String server, CallbackHandler cbh) Create a new instance of a SaslClient which supports SCRAM-SHA-1 -
Method Summary
Modifier and TypeMethodDescriptionvoid
dispose()
Delete objectbyte[]
evaluateChallenge
(byte[] arg0) Evaluate a challengeReturn the name of this client's mechanismgetNegotiatedProperty
(String arg0) Get a negotiated propertyboolean
Whether this mechanism provides an initial responseboolean
Whether authentication is complete or notbyte[]
unwrap
(byte[] arg0, int arg1, int arg2) Unwrap data - not yet implementedbyte[]
wrap
(byte[] arg0, int arg1, int arg2) Wrap data - not yet implemented
-
Constructor Details
-
SomScramSha1Client
public SomScramSha1Client(String authzid, String protocol, String server, CallbackHandler cbh) throws SaslException Create a new instance of a SaslClient which supports SCRAM-SHA-1- Parameters:
authzid
- authorization idprotocol
- not usedserver
- not usedcbh
- callback handler- Throws:
SaslException
- on error
-
-
Method Details
-
dispose
Delete object- Specified by:
dispose
in interfaceSaslClient
- Throws:
SaslException
- for compatibility
-
evaluateChallenge
Evaluate a challenge- Specified by:
evaluateChallenge
in interfaceSaslClient
- Parameters:
arg0
- the challenge string- Throws:
SaslException
-
getMechanismName
Return the name of this client's mechanism- Specified by:
getMechanismName
in interfaceSaslClient
- Returns:
- mechanism name
-
getNegotiatedProperty
Get a negotiated property- Specified by:
getNegotiatedProperty
in interfaceSaslClient
- Parameters:
arg0
- the property to get- Returns:
- property value
-
hasInitialResponse
public boolean hasInitialResponse()Whether this mechanism provides an initial response- Specified by:
hasInitialResponse
in interfaceSaslClient
- Returns:
- boolean value
-
isComplete
public boolean isComplete()Whether authentication is complete or not- Specified by:
isComplete
in interfaceSaslClient
- Returns:
- boolean value
-
unwrap
Unwrap data - not yet implemented- Specified by:
unwrap
in interfaceSaslClient
- Parameters:
arg0
- notusedarg1
- notusedarg2
- notused- Returns:
- the unwrapped data
- Throws:
SaslException
- on error
-
wrap
Wrap data - not yet implemented- Specified by:
wrap
in interfaceSaslClient
- Parameters:
arg0
- notusedarg1
- notusedarg2
- notused- Returns:
- the unwrapped data
- Throws:
SaslException
- on error
-