The getProvider()
method is used to get the provider
for the SecureRandom
object. The provider
contains encryption algorithms. This method is provided by the SecureRandom
class, which consists of methods to generate strong random numbers.
We can get the provider
of the current instance of the SecureRandom
object using the getProvider()
method.
public final Provider getProvider()
This method doesn't take any parameters.
This method returns the provider
of the SecureRandom
object on which it is called.
import java.security.*;import java.util.*;public class main {public static void main(String[] argv){//create instance of securerandomSecureRandom rndm = new SecureRandom();//get provider of secure random objectSystem.out.println(rndm.getProvider());}}
SecureRandom
class and assign it to the variable, rndm
.provider
of the SecureRandom
object, rndm
, using the getProvider()
method and display it.Free Resources