Java中的提供程序keys()方法
可以使用keys()类java.security.Provider中的方法获得所需哈希表的键的枚举。此方法不需要任何参数,它返回哈希表的键的枚举。
演示此的程序如下所示-
示例
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();
Enumeration<Object> enumeration = p.keys();
System.out.println("The enumeration of the keys is as follows: \n");
int x = 30;
while (x > 0) {
System.out.println(enumeration.nextElement());
x--;
}
} catch (NoSuchAlgorithmException e) {
System.out.println("Error!!! NoSuchAlgorithmException");
}
}
}输出结果
The enumeration of the keys is as follows: Alg.Alias.Signature.SHA1/DSA Alg.Alias.Signature.1.2.840.10040.4.3 Alg.Alias.Signature.DSS SecureRandom.SHA1PRNG ImplementedIn KeyStore.JKS Alg.Alias.MessageDigest.SHA-1 MessageDigest.SHA KeyStore.CaseExactJKS CertStore.com.sun.security.IndexedCollection ImplementedIn Signature.SHA256withDSA Alg.Alias.MessageDigest.OID.1.3.14.3.2.26 Alg.Alias.Signature.DSA KeyFactory.DSA ImplementedIn KeyStore.JKS ImplementedIn AlgorithmParameters.DSA ImplementedIn Signature.NONEwithDSA Alg.Alias.CertificateFactory.X509 Signature.SHA256withDSA SupportedKeyClasses CertStore.com.sun.security.IndexedCollection Provider.id className Alg.Alias.MessageDigest.1.3.14.3.2.26 Alg.Alias.Signature.SHA-1/DSA KeyStore.DKS CertificateFactory.X.509 ImplementedIn Alg.Alias.Signature.OID.2.16.840.1.101.3.4.3.2 Alg.Alias.Signature.OID.2.16.840.1.101.3.4.3.1 Signature.SHA1withDSA KeySize Signature.NONEwithDSA KeySize CertPathValidator.PKIX ImplementedIn KeyFactory.DSA
热门推荐
10 八一幼儿祝福语大全简短
11 公司乔迁食堂祝福语简短
12 婚礼结束聚餐祝福语简短
13 儿媳买车妈妈祝福语简短
14 毕业送礼老师祝福语简短
15 同事辞职正常祝福语简短
16 恭贺新婚文案祝福语简短
17 金店立秋祝福语简短英文
18 婆婆高寿祝福语大全简短