
- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Provider keys() method in Java
An enumeration of the keys of the required hash table can be obtained using the keys() method in the class java.security.Provider. This method requires no parameters and it returns the enumeration of the keys of the hash table.
A program that demonstrates this is given as follows −
Example
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"); } } }
Output
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
- Related Questions & Answers
- Provider elements() method in Java
- Provider entrySet() method in Java
- Provider keySet() method in Java
- Provider values() method in Java
- Provider get() method in Java
- Provider getInfo() method in Java
- Provider getName() method in Java
- Provider getVersion() method in Java
- Provider toString() method in Java
- Provider getProperty() method in Java
- Provider getService() method in Java
- The Keys and values method in Javascript
- How does Python dictionary keys() Method work?
- Sort HashMap based on keys in Java
- How can we create a Service Provider interface in Java 9?
Advertisements