Java SecureRandom.getAlgorithm()

Syntax

SecureRandom.getAlgorithm() has the following syntax.

public String getAlgorithm()

Example

In the following code shows how to use SecureRandom.getAlgorithm() method.


/*from   ww  w . ja  v a  2  s. c  o  m*/
import java.security.SecureRandom;

public class Main {
  public static void main(String[] argv) throws Exception {
    SecureRandom sr = SecureRandom.getInstance("SHA1PRNG");


    System.out.println(sr.getAlgorithm());
  }
}




















Home »
  Java Tutorial »
    java.security »




SecureRandom