Package tigase.auth.mechanisms

# Class SCRAMHelper

java.lang.Object
tigase.auth.mechanisms.SCRAMHelper

public class SCRAMHelper extends Object

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static final record`
  `SCRAMHelper.AuthenticationData`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static SCRAMHelper.AuthenticationData`
  `encodePlainPassword(String algorithm, byte[] salt, int iterations, String plainPassword)`
  Encode plain password to SCRAM authentication data: ServerKey and StoredKey.
  `static SCRAMHelper.AuthenticationData`
  `transcode(String algorithm, byte[] saltedPassword)`
  Transcode Salted Password (PBKDF2) to SCRAM authentication data: ServerKey and StoredKey.

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

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

- ## Method Details

  - ### encodePlainPassword

    public static SCRAMHelper.AuthenticationData encodePlainPassword(String algorithm, byte[] salt, int iterations, String plainPassword) throws NoSuchAlgorithmException, InvalidKeyException
    Encode plain password to SCRAM authentication data: ServerKey and StoredKey.
    Parameters:
      `algorithm` - algorithm.
      `salt` - salt.
      `iterations` - iterations.
      `plainPassword` - plain password.
    Returns:
      authentication data
    Throws:
      `NoSuchAlgorithmException`
      `InvalidKeyException`

  - ### transcode

    public static SCRAMHelper.AuthenticationData transcode(String algorithm, byte[] saltedPassword) throws NoSuchAlgorithmException, InvalidKeyException
    Transcode Salted Password (PBKDF2) to SCRAM authentication data: ServerKey and StoredKey.
    Parameters:
      `algorithm` - algorithm.
      `saltedPassword` - salted password to transcode.
    Returns:
      authentication data.
    Throws:
      `NoSuchAlgorithmException`
      `InvalidKeyException`