Package com.isode.som
Class SomScramSha1Client
- java.lang.Object
-
- com.isode.som.SomScramSha1Client
-
- All Implemented Interfaces:
javax.security.sasl.SaslClient
public class SomScramSha1Client extends java.lang.Object implements javax.security.sasl.SaslClientClass 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
Constructors Constructor Description SomScramSha1Client(java.lang.String authzid, java.lang.String protocol, java.lang.String server, javax.security.auth.callback.CallbackHandler cbh)Create a new instance of a SaslClient which supports SCRAM-SHA-1
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Delete objectbyte[]evaluateChallenge(byte[] arg0)Evaluate a challengejava.lang.StringgetMechanismName()Return the name of this client's mechanismjava.lang.ObjectgetNegotiatedProperty(java.lang.String arg0)Get a negotiated propertybooleanhasInitialResponse()Whether this mechanism provides an initial responsebooleanisComplete()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 Detail
-
SomScramSha1Client
public SomScramSha1Client(java.lang.String authzid, java.lang.String protocol, java.lang.String server, javax.security.auth.callback.CallbackHandler cbh) throws javax.security.sasl.SaslExceptionCreate a new instance of a SaslClient which supports SCRAM-SHA-1- Parameters:
authzid- authorization idprotocol- not usedserver- not usedcbh- callback handler- Throws:
javax.security.sasl.SaslException- on error
-
-
Method Detail
-
dispose
public void dispose() throws javax.security.sasl.SaslExceptionDelete object- Specified by:
disposein interfacejavax.security.sasl.SaslClient- Throws:
javax.security.sasl.SaslException- for compatibility
-
evaluateChallenge
public byte[] evaluateChallenge(byte[] arg0) throws javax.security.sasl.SaslExceptionEvaluate a challenge- Specified by:
evaluateChallengein interfacejavax.security.sasl.SaslClient- Parameters:
arg0- the challenge string- Throws:
javax.security.sasl.SaslException
-
getMechanismName
public java.lang.String getMechanismName()
Return the name of this client's mechanism- Specified by:
getMechanismNamein interfacejavax.security.sasl.SaslClient- Returns:
- mechanism name
-
getNegotiatedProperty
public java.lang.Object getNegotiatedProperty(java.lang.String arg0)
Get a negotiated property- Specified by:
getNegotiatedPropertyin interfacejavax.security.sasl.SaslClient- Parameters:
arg0- the property to get- Returns:
- property value
-
hasInitialResponse
public boolean hasInitialResponse()
Whether this mechanism provides an initial response- Specified by:
hasInitialResponsein interfacejavax.security.sasl.SaslClient- Returns:
- boolean value
-
isComplete
public boolean isComplete()
Whether authentication is complete or not- Specified by:
isCompletein interfacejavax.security.sasl.SaslClient- Returns:
- boolean value
-
unwrap
public byte[] unwrap(byte[] arg0, int arg1, int arg2) throws javax.security.sasl.SaslExceptionUnwrap data - not yet implemented- Specified by:
unwrapin interfacejavax.security.sasl.SaslClient- Parameters:
arg0- notusedarg1- notusedarg2- notused- Returns:
- the unwrapped data
- Throws:
javax.security.sasl.SaslException- on error
-
wrap
public byte[] wrap(byte[] arg0, int arg1, int arg2) throws javax.security.sasl.SaslExceptionWrap data - not yet implemented- Specified by:
wrapin interfacejavax.security.sasl.SaslClient- Parameters:
arg0- notusedarg1- notusedarg2- notused- Returns:
- the unwrapped data
- Throws:
javax.security.sasl.SaslException- on error
-
-