Class MD5HashFunction

java.lang.Object
eu.webtoolkit.jwt.auth.HashFunction
eu.webtoolkit.jwt.auth.MD5HashFunction

public class MD5HashFunction
extends HashFunction
A cryptograhpic hash function implemented using MD5. This hash function is useful for creating token hashes, but should not be used for password hashes.
  • Constructor Summary

    Constructors 
    Constructor Description
    MD5HashFunction()  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String compute​(java.lang.String msg, java.lang.String salt)
    Computes the hash of a message + salt.
    java.lang.String getName()
    Returns the name for this hash function.

    Methods inherited from class eu.webtoolkit.jwt.auth.HashFunction

    verify

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • compute

      public java.lang.String compute​(java.lang.String msg, java.lang.String salt)
      Description copied from class: HashFunction
      Computes the hash of a message + salt.

      The message is usually an ASCII or UTF-8 string.

      The salt and the computed hash are encoded in printable characters. This is usually ASCII-encoded or could be Base64-encoded.

      Specified by:
      compute in class HashFunction
    • getName

      public java.lang.String getName()
      Returns the name for this hash function. Returns "MD5".
      Specified by:
      getName in class HashFunction