Class XRoutineWithUserIdentity

java.lang.Object
de.bsvrz.sys.funclib.srp6.XRoutineWithUserIdentity
All Implemented Interfaces:
XRoutine

public class XRoutineWithUserIdentity extends Object implements XRoutine
Alternative routine for computing a password key x = H(s | H(I | ":" | P))

Specification: RFC 5054.

This routine can be passed to the SRP6VerifierGenerator and SRP6ClientSession to replace the default routine x = H(s | H(P)).

  • Constructor Details

    • XRoutineWithUserIdentity

      public XRoutineWithUserIdentity()
  • Method Details

    • computeX

      public BigInteger computeX(MessageDigest digest, byte[] salt, byte[] username, byte[] password)
      Computes x = H(s | H(I | ":" | P))

      This method complies with the RFC 5054 recommendation, save for the hash algorithm which can be any (RFC 5054 recommends SHA-1).

      Specified by:
      computeX in interface XRoutine
      Parameters:
      digest - The hash function 'H'. Must not be null.
      salt - The salt 's'. Must not be null.
      username - The user identity 'I'. Must not be null.
      password - The user password 'P'. Must not be null.
      Returns:
      The resulting 'x' value.
    • toString

      public String toString()
      Returns a string representation of this routine algorithm.
      Overrides:
      toString in class Object
      Returns:
      "H(s | H(I | ":" | P))"