java.lang.Object
net.finmath.smartcontracts.representablestate.xml.util.Util

public class Util extends Object
Utilities related to encryption/decryption/hashing
Author:
Christian Fries
  • Constructor Details

    • Util

      public Util()
  • Method Details

    • getHex

      public static String getHex(byte[] bytes)

      getHex.

      Parameters:
      bytes - an array of byte
      Returns:
      a String object representing the byte array in hex.
    • getHexTrimmed

      public static String getHexTrimmed(byte[] bytes)

      getHexTrimmed.

      Parameters:
      bytes - an array of byte
      Returns:
      a String object representing the byte array in base64.
    • getHexTrimmed

      public static String getHexTrimmed(byte[] bytes, int len)

      getHexTrimmed.

      Parameters:
      bytes - an array of byte
      len - the length to represent
      Returns:
      a String object with starting hex encodings of the byte array.
    • getBase64

      public static String getBase64(byte[] bytes)

      getBase64.

      Parameters:
      bytes - an array of byte
      Returns:
      a String object
    • generateRandomSecret

      public static byte[] generateRandomSecret()
      Generate a random secrete (base64 encoded).
      Returns:
      A string representing a random secret.
    • publicKeyFromPath

      public static PublicKey publicKeyFromPath(Path path)

      publicKeyFromPath.

      Parameters:
      path - a Path object
      Returns:
      a PublicKey object
    • privateKeyFromPath

      public static PrivateKey privateKeyFromPath(Path path)

      privateKeyFromPath.

      Parameters:
      path - a Path object
      Returns:
      a PrivateKey object