Klasse Nonce

java.lang.Object
de.uplanet.security.Nonce

@Scriptable public final class Nonce extends Object
Used to create cryptographically secure random bits that can be used as nonce values.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    static byte[]
    getBinary(int p_iLen)
    Create a cryptographically secure hex-encoded nonce value of the given length in bytes.
    static String
    getString(int p_iLen)
    Create a cryptographically secure hex-encoded nonce value of the given length in bytes.
    static String
    getString58(int p_iLen)
    Create a cryptographically secure nonce value of the given length consisting of characters from the Base58 alphabet.

    Von Klasse geerbte Methoden java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Methodendetails

    • getString

      public static String getString(int p_iLen)
      Create a cryptographically secure hex-encoded nonce value of the given length in bytes.

      Note that the length of the returned hex-encoded string is twice of the length in bytes.

      Parameter:
      p_iLen - The length of the nonce value in bytes.
      Gibt zurück:
      The hex-encoded nonce value.
    • getBinary

      public static byte[] getBinary(int p_iLen)
      Create a cryptographically secure hex-encoded nonce value of the given length in bytes.
      Parameter:
      p_iLen - The length of the nonce value in bytes.
      Gibt zurück:
      The nonce value.
    • getString58

      public static String getString58(int p_iLen)
      Create a cryptographically secure nonce value of the given length consisting of characters from the Base58 alphabet.

      The entropy of the values created by this method is p_iLen * log(58) / log(2).

      Parameter:
      p_iLen - The length of the nonce value in bytes.
      Gibt zurück:
      The hex-encoded nonce value.