KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > java > security > SecureRandom

java.security
Class SecureRandom

java.lang.Object
  extended by java.util.Random
      extended by java.security.SecureRandom
All Implemented Interfaces:
Serializable
See Also:
Top Examples, Source Code, SecureRandomSpi

public byte[] generateSeed(int numBytes)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getAlgorithm()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static SecureRandom getInstance(String algorithm)
                                throws NoSuchAlgorithmException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1871]
By Punya Sheel on 2007/04/10 05:26:03  Rate
// create an instance of Secure Random for an algorithm 
 SecureRandom random = SecureRandom.getInstance ( "SHA1PRNG" ) ; 
 // bSomeBytes will be populated with random values using following 
 // two steps. 
 byte [  ]  bSomeBytes = new byte [ 16 ] ; 
 random.nextBytes ( bSomeBytes ) ;


public static SecureRandom getInstance(String algorithm,
                                       String provider)
                                throws NoSuchAlgorithmException,
                                       NoSuchProviderException
See Also:
Provider, IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static SecureRandom getInstance(String algorithm,
                                       Provider provider)
                                throws NoSuchAlgorithmException
See Also:
IllegalArgumentException
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public final Provider getProvider()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static byte[] getSeed(int numBytes)
See Also:
setSeed(byte[])
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected final int next(int numBits)
See Also:
Random
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void nextBytes(byte[] bytes)
See Also:
Random
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[1870]
By Punya Sheel on 2007/04/10 05:25:48  Rate
// create an instance of Secure Random for an algorithm 
 SecureRandom random = SecureRandom.getInstance ( "SHA1PRNG" ) ; 
 // bSomeBytes will be populated with random values using following 
 // two steps. 
 byte [  ]  bSomeBytes = new byte [ 16 ] ; 
 random.nextBytes ( bSomeBytes ) ;


public SecureRandom()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[586]Generate cryptographically strong random number
By Anonymous on 2003/12/23 16:21:09  Rate
java.security.SecureRandom seeder = new java.security.SecureRandom (  ) ; 
 int node = seeder.nextInt (  ) ;


public SecureRandom(byte[] seed)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


protected SecureRandom(SecureRandomSpi secureRandomSpi,
                       Provider provider)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setSeed(byte[] seed)
See Also:
getSeed(int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public void setSeed(long seed)
See Also:
getSeed(int), Random
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags