Provider getInfo() method in Java

Java 8ProgrammingObject Oriented Programming

An easily readable description of the provider and its services can be obtained using the method getInfo() in the class This method requires no parameters and it returns a provider and services description.

A program that demonstrates this is given as follows −


 Live Demo

import java.util.*;
public class Demo {
   public static void main(String[] argv) throws Exception {
      try {
         SecureRandom sRandom = SecureRandom.getInstance("SHA1PRNG");
         Provider p = sRandom.getProvider();
         System.out.println("The information is as follows:\n");
      } catch (NoSuchAlgorithmException e) {
         System.out.println("Error!!! NoSuchAlgorithmException");


The information is as follows:
SUN (DSA key/parameter generation; DSA signing; SHA-1, MD5 digests; SecureRandom; X.509 certificates; JKS & DKS keystores; PKIX CertPathValidator; PKIX CertPathBuilder; LDAP, Collection CertStores, JavaPolicy Policy; JavaLoginConfig Configuration)
Published on 12-Mar-2019 12:15:15