Java中的提供者getInfo()方法
使用getInfo()类java.security.Provider中的方法可以获得提供者及其服务的易于理解的描述。此方法不需要任何参数,它返回提供程序和服务描述。
演示此的程序如下所示-
示例
import java.security.*;
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");
System.out.println(p.getInfo());
} 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)
热门推荐
10 道教生日祝福语简短大全
11 给女儿祝福语简短精辟
12 18岁的祝福语简短
13 贺卡祝福语情侣搞笑简短
14 关于扬州的祝福语简短
15 生了女孩祝福语简短的
16 儿子31岁祝福语简短
17 爱小姨文案祝福语简短
18 小清新的祝福语简短