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 侄儿高考试祝福语简短
13 伴郎红包祝福语朋友简短
14 媳妇生日简短祝福语朋友
15 公司年会祝福语简短最好
16 元旦感恩祝福语简短大全
17 红包祝福语简短10字
18 周六早晨祝福语简短