java中values_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 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个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值