Class Nonce


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

      • 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.

        Parameters:
        p_iLen - The length of the nonce value in bytes.
        Returns:
        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.
        Parameters:
        p_iLen - The length of the nonce value in bytes.
        Returns:
        The nonce value.