Package com.isode.som

Class SomScramSha1Client

java.lang.Object
com.isode.som.SomScramSha1Client
All Implemented Interfaces:
SaslClient

public class SomScramSha1Client extends Object implements 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 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 id
      protocol - not used
      server - not used
      cbh - callback handler
      Throws:
      SaslException - on error
  • Method Details

    • dispose

      public void dispose() throws SaslException
      Delete object
      Specified by:
      dispose in interface SaslClient
      Throws:
      SaslException - for compatibility
    • evaluateChallenge

      public byte[] evaluateChallenge(byte[] arg0) throws SaslException
      Evaluate a challenge
      Specified by:
      evaluateChallenge in interface SaslClient
      Parameters:
      arg0 - the challenge string
      Throws:
      SaslException
    • getMechanismName

      public String getMechanismName()
      Return the name of this client's mechanism
      Specified by:
      getMechanismName in interface SaslClient
      Returns:
      mechanism name
    • getNegotiatedProperty

      public Object getNegotiatedProperty(String arg0)
      Get a negotiated property
      Specified by:
      getNegotiatedProperty in interface SaslClient
      Parameters:
      arg0 - the property to get
      Returns:
      property value
    • hasInitialResponse

      public boolean hasInitialResponse()
      Whether this mechanism provides an initial response
      Specified by:
      hasInitialResponse in interface SaslClient
      Returns:
      boolean value
    • isComplete

      public boolean isComplete()
      Whether authentication is complete or not
      Specified by:
      isComplete in interface SaslClient
      Returns:
      boolean value
    • unwrap

      public byte[] unwrap(byte[] arg0, int arg1, int arg2) throws SaslException
      Unwrap data - not yet implemented
      Specified by:
      unwrap in interface SaslClient
      Parameters:
      arg0 - notused
      arg1 - notused
      arg2 - notused
      Returns:
      the unwrapped data
      Throws:
      SaslException - on error
    • wrap

      public byte[] wrap(byte[] arg0, int arg1, int arg2) throws SaslException
      Wrap data - not yet implemented
      Specified by:
      wrap in interface SaslClient
      Parameters:
      arg0 - notused
      arg1 - notused
      arg2 - notused
      Returns:
      the unwrapped data
      Throws:
      SaslException - on error