getinstance java code example
Example 1: getinstance java
import java.security.*;
import java.util.*;
public class GFG1 {
public static void main(String[] argv)
{
try {
Signature sr = Signature.getInstance("SHA1WithRSA");
String str = sr.toString();
System.out.println("Status : " + str);
}
catch (NoSuchAlgorithmException e) {
System.out.println("Exception thrown : " + e);
}
catch (ProviderException e) {
System.out.println("Exception thrown : " + e);
}
}
}
Example 2: getinstance java
import java.security.*;
import java.util.*;
public class GFG1 {
public static void main(String[] argv)
{
try {
Signature sr = Signature.getInstance("SHA1WithRSA");
String str = sr.toString();
System.out.println("Status : " + str);
}
catch (NoSuchAlgorithmException e) {
System.out.println("Exception thrown : " + e);
}
catch (ProviderException e) {
System.out.println("Exception thrown : " + e);
}
}
}