Package org.apache.wicket.core.random
Interface ISecureRandomSupplier
-
- All Known Implementing Classes:
DefaultSecureRandomSupplier
public interface ISecureRandomSupplier
Supplies the Wicket application with random bytes.- Author:
- papegaaij
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SecureRandom
getRandom()
Returns the actualSecureRandom
being used as source.default String
getRandomBase64(int length)
Returns a url-base64 encoded string with random content, base onlength
bytes.default byte[]
getRandomBytes(int length)
Returns a byte array with random bytes of the given length.
-
-
-
Method Detail
-
getRandom
SecureRandom getRandom()
Returns the actualSecureRandom
being used as source.- Returns:
- The
SecureRandom
.
-
getRandomBytes
default byte[] getRandomBytes(int length)
Returns a byte array with random bytes of the given length.- Parameters:
length
- The number of bytes to return.- Returns:
- A byte array with random bytes of the given length.
-
getRandomBase64
default String getRandomBase64(int length)
Returns a url-base64 encoded string with random content, base onlength
bytes. The length of the returned string will belength/3*4
.- Parameters:
length
- The number of random bytes to use as input.- Returns:
- A string with random base64 data.
-
-