Java中的提供程序values()方法
可以使用使用values()类java.security.Provider中的方法获得的不可修改的Collection视图来查看Provider中的属性值。此方法不需要任何参数,并且返回属性值的不可修改的Collection视图。
演示此的程序如下所示-
示例
import java.security.*;
import java.util.*;
public class Demo {
public static void main(String[] argv) throws Exception {
try {
Signature sign = Signature.getInstance("DSA");
Provider p = sign.getProvider();
Collection<Object> val = p.values();
Iterator i = val.iterator();
System.out.println("The unmodifiable Collection view is: \n");
int x = 30;
while (x > 0) {
System.out.println(i.next());
x--;
}
} catch (NoSuchAlgorithmException e) {
System.out.println("Error!!! NoSuchAlgorithmException");
}
}
}输出结果
The unmodifiable Collection view is: SHA1withDSA SHA1withDSA SHA1withDSA Software sun.security.provider.JavaKeyStore$DualFormatJKS SHA sun.security.provider.SHA sun.security.provider.JavaKeyStore$CaseExactJKS Software sun.security.provider.DSA$SHA256withDSA SHA SHA1withDSA Software Software Software sun.security.provider.DSA$RawDSA X.509 java.security.interfaces.DSAPublicKey|java.security.interfaces.DSAPrivateKey sun.security.provider.certpath.IndexedCollectionCertStore sun.security.provider.Sun SHA SHA1withDSA sun.security.provider.DomainKeyStore$DKS Software SHA256withDSA SHA224withDSA 1024 1024 Software sun.security.provider.DSAKeyFactory
热门推荐
10 香港老妈结婚祝福语简短
11 毕业立体贺卡祝福语简短
12 简短新年年会祝福语
13 评论小品祝福语大全简短
14 恭喜师兄结婚祝福语简短
15 员工集体辞职祝福语简短
16 高中新生祝福语 简短
17 装修祝福语男生搞笑简短
18 生日开业蛋糕祝福语简短