Package de.uplanet.security
Class 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.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.
-
-
-
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.
-
-