java.lang.Object
io.getlime.security.powerauth.crypto.lib.util.Hash

public class Hash extends Object
Simple utility class that provides the basic hash methods.

Supported methods:

- SHA256

Author:
Petr Dvorak, petr@wultra.com
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static byte[]
    sha256(byte[] originalBytes)
    Compute SHA256 hash of provided bytes.
    static byte[]
    sha256(String string)
    Compute SHA256 hash of provided string, that was transferred to data using UTF-8 charset.
    static byte[]
    sha256(String string, Charset charset)
    Compute SHA256 hash of provided string, that was transferred to data using provided charset.

    Methods inherited from class java.lang.Object

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

    • Hash

      public Hash()
  • Method Details

    • sha256

      public static byte[] sha256(byte[] originalBytes)
      Compute SHA256 hash of provided bytes.
      Parameters:
      originalBytes - Original bytes.
      Returns:
      SHA256 hash of provided original bytes.
    • sha256

      public static byte[] sha256(String string)
      Compute SHA256 hash of provided string, that was transferred to data using UTF-8 charset.
      Parameters:
      string - String to be hashed.
      Returns:
      SHA256 hash of provided string.
    • sha256

      public static byte[] sha256(String string, Charset charset)
      Compute SHA256 hash of provided string, that was transferred to data using provided charset.
      Parameters:
      string - Original string to be hashed.
      charset - Charset to be used to convert string to bytes.
      Returns:
      SHA256 hash of provided string.