Package tigase.auth.mechanisms

# Class AbstractSaslSCRAM

java.lang.Object
tigase.auth.mechanisms.AbstractSasl
tigase.auth.mechanisms.AbstractSaslSCRAM

All Implemented Interfaces:
  `SaslServer`

Direct Known Subclasses:
  `SaslSCRAM`, `SaslSCRAMPlus`, `SaslSCRAMSha256`, `SaslSCRAMSha256Plus`, `SaslSCRAMSha512`, `SaslSCRAMSha512Plus`

public abstract class AbstractSaslSCRAM extends AbstractSasl

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `AbstractSaslSCRAM.BindType`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `LOCAL_CERTIFICATE_KEY`
  `static final String`
  `TLS_EXPORTER_KEY`
  `static final String`
  `TLS_UNIQUE_ID_KEY`

  ### Fields inherited from class tigase.auth.mechanisms.AbstractSasl

  `authorizedId, callbackHandler, complete, log, negotiatedProperty, PASSWORD_NOT_VERIFIED_MSG, props, SASL_STRICT_MODE_KEY`

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `AbstractSaslSCRAM(String mechanismName, String algorithm, Map<? super String,?> props, CallbackHandler callbackHandler)`
  `protected`
  `AbstractSaslSCRAM(String mechanismName, String algorithm, Map<? super String,?> props, CallbackHandler callbackHandler, String serverOnce)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected byte[]`
  `calculateC()`
  `protected abstract void`
  `checkRequestedBindType(AbstractSaslSCRAM.BindType requestedBindType)`
  `byte[]`
  `evaluateResponse(byte[] response)`
  `String`
  `getAuthorizationID()`
  `String`
  `getMechanismName()`
  `static Element`
  `getSupportedChannelBindings(XMPPResourceConnection session)`
  `protected byte[]`
  `h(byte[] data)`
  `static byte[]`
  `h(String algorithm, byte[] data)`
  `static byte[]`
  `hi(String algorithm, byte[] password, byte[] salt, int iterations)`
  `static byte[]`
  `hmac(String algorithm, byte[] key, byte[] data)`
  `protected static byte[]`
  `hmac(SecretKey key, byte[] data)`
  `protected SecretKey`
  `key(byte[] key)`
  `static byte[]`
  `normalize(String str)`
  `protected byte[]`
  `processClientFirstMessage(byte[] data)`
  `protected byte[]`
  `processClientLastMessage(byte[] data)`
  `byte[]`
  `unwrap(byte[] incoming, int offset, int len)`
  `protected void`
  `validateBindingsData(AbstractSaslSCRAM.BindType requestedBindType, byte[] bindingData)`
  `byte[]`
  `wrap(byte[] outgoing, int offset, int len)`
  `protected byte[]`
  `xor(byte[] a, byte[] b)`

  ### Methods inherited from class tigase.auth.mechanisms.AbstractSasl

  `dispose, getNegotiatedProperty, handleCallbacks, isAuthzIDIgnored, isComplete, isEmpty, split`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### TLS_UNIQUE_ID_KEY

    public static final String TLS_UNIQUE_ID_KEY
    See Also:
      - Constant Field Values

  - ### TLS_EXPORTER_KEY

    public static final String TLS_EXPORTER_KEY
    See Also:
      - Constant Field Values

  - ### LOCAL_CERTIFICATE_KEY

    public static final String LOCAL_CERTIFICATE_KEY
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### AbstractSaslSCRAM

    protected AbstractSaslSCRAM(String mechanismName, String algorithm, Map<? super String,?> props, CallbackHandler callbackHandler)

  - ### AbstractSaslSCRAM

    protected AbstractSaslSCRAM(String mechanismName, String algorithm, Map<? super String,?> props, CallbackHandler callbackHandler, String serverOnce)

- ## Method Details

  - ### getSupportedChannelBindings

    public static Element getSupportedChannelBindings(XMPPResourceConnection session)

  - ### h

    public static byte[] h(String algorithm, byte[] data) throws NoSuchAlgorithmException
    Throws:
      `NoSuchAlgorithmException`

  - ### hi

    public static byte[] hi(String algorithm, byte[] password, byte[] salt, int iterations) throws InvalidKeyException, NoSuchAlgorithmException
    Throws:
      `InvalidKeyException`
      `NoSuchAlgorithmException`

  - ### hmac

    protected static byte[] hmac(SecretKey key, byte[] data) throws NoSuchAlgorithmException, InvalidKeyException
    Throws:
      `NoSuchAlgorithmException`
      `InvalidKeyException`

  - ### hmac

    public static byte[] hmac(String algorithm, byte[] key, byte[] data) throws NoSuchAlgorithmException, InvalidKeyException
    Throws:
      `NoSuchAlgorithmException`
      `InvalidKeyException`

  - ### normalize

    public static byte[] normalize(String str)

  - ### evaluateResponse

    public byte[] evaluateResponse(byte[] response) throws SaslException
    Throws:
      `SaslException`

  - ### getAuthorizationID

    public String getAuthorizationID()

  - ### getMechanismName

    public String getMechanismName()

  - ### unwrap

    public byte[] unwrap(byte[] incoming, int offset, int len)

  - ### wrap

    public byte[] wrap(byte[] outgoing, int offset, int len)

  - ### calculateC

    protected byte[] calculateC()

  - ### checkRequestedBindType

    protected abstract void checkRequestedBindType(AbstractSaslSCRAM.BindType requestedBindType) throws SaslException
    Throws:
      `SaslException`

  - ### h

    protected byte[] h(byte[] data) throws NoSuchAlgorithmException
    Throws:
      `NoSuchAlgorithmException`

  - ### key

    protected SecretKey key(byte[] key)

  - ### processClientFirstMessage

    protected byte[] processClientFirstMessage(byte[] data) throws SaslException
    Throws:
      `SaslException`

  - ### processClientLastMessage

    protected byte[] processClientLastMessage(byte[] data) throws SaslException, InvalidKeyException, NoSuchAlgorithmException
    Throws:
      `SaslException`
      `InvalidKeyException`
      `NoSuchAlgorithmException`

  - ### validateBindingsData

    protected void validateBindingsData(AbstractSaslSCRAM.BindType requestedBindType, byte[] bindingData)

  - ### xor

    protected byte[] xor(byte[] a, byte[] b)