Class CryptoRandom

java.lang.Object
org.webpki.crypto.CryptoRandom

public class CryptoRandom extends Object
Support class to SecureRandom.
  • Method Details

    • generateRandom

      public static byte[] generateRandom(int length)
      Generates byte array with random data.
      Parameters:
      length - Number of bytes
      Returns:
      byteArray
    • generateURLFriendlyRandom

      public static String generateURLFriendlyRandom(int length)
      Generates a URL friendly encoded nonce.

      Note: although the characters are derived from Bas64URL, the string is NOT intended to be decoded!

      Parameters:
      length - Number of characters
      Returns:
      Encoded nonce