aerogear-crypto 0.1.1

org.jboss.aerogear.crypto
Class Random

java.lang.Object
  extended by org.jboss.aerogear.crypto.Random

public class Random
extends Object

Provides a cryptographically strong RNG


Field Summary
private static String ALGORITHM
           
private  SecureRandom secureRandom
           
 
Constructor Summary
Random()
          Initializes the class with the default algorithm supported
Random(String algorithm)
          Initializes the class with the provided RNG algorithm name
 
Method Summary
 SecureRandom getSecureRandom()
          Retrieve the reference to the SecureRandom object
 byte[] randomBytes()
          Generates a number random bytes which defaults to the buffer of 16
 byte[] randomBytes(int n)
          Generates a number random bytes specified by the user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

secureRandom

private SecureRandom secureRandom

ALGORITHM

private static final String ALGORITHM
See Also:
Constant Field Values
Constructor Detail

Random

public Random()
Initializes the class with the default algorithm supported


Random

public Random(String algorithm)
Initializes the class with the provided RNG algorithm name

Parameters:
algorithm - name provided
Method Detail

randomBytes

public byte[] randomBytes()
Generates a number random bytes which defaults to the buffer of 16

Returns:
byte array representation of random bytes

randomBytes

public byte[] randomBytes(int n)
Generates a number random bytes specified by the user

Returns:
byte array representation of random bytes

getSecureRandom

public SecureRandom getSecureRandom()
Retrieve the reference to the SecureRandom object

Returns:
SecureRandom

aerogear-crypto 0.1.1

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.