Found 9150 Articles for Object Oriented Programming

Provider values() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

144 Views

The property values in the Provider can be viewed with an unmodifiable Collection view that is obtained using the method values() in the class java.security.Provider. This method requires no parameters and it returns an unmodifiable Collection view of the property values.A program that demonstrates this is given as follows −Example Live Demoimport 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();         ... Read More

Provider keySet() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

134 Views

The property keys in the provider can be viewed using an unmodifiable Set view using the method keySet() in the class java.security.Provider. This method requires no parameters and it returns the unmodifiable Set view for the property keys as required.A program that demonstrates this is given as follows −Example Live Demoimport 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();          Set set = p.keySet();          Iterator ... Read More

Provider keys() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

138 Views

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 Live Demoimport 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 enumeration = p.keys();          System.out.println("The enumeration of ... Read More

Provider getService() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

334 Views

The service that can describe the implementation of a Provider in regards to any algorithm is obtained using the method getService() in the class java.security.Provider. This method requires two parameters i.e. the service type required and the algorithm name of the required service.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) throws Exception {       try {          Signature sign = Signature.getInstance("SHA256withDSA");          Provider p = sign.getProvider();          Provider.Service s = p.getService("Signature", sign.getAlgorithm());   ... Read More

Provider getProperty() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

314 Views

A specific key can be used to search for the required property in the property list using the method getProperty() in the class java.security.Provider. This method requires a single parameter i.e. the key required to search for the property. It returns the property value for the key or returns null if the property value is not available.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) throws Exception {       try {          KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("DSA");         ... Read More

Provider toString() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

197 Views

The name and the version number of the provider in string form can be obtained using the method toString() in the class java.security.Provider. This method requires no parameters and it returns the name as well as the version number of the provider in string form.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("DSA");          Provider p = kpGenerator.getProvider();          System.out.println("The name and version number of ... Read More

Provider getVersion() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

244 Views

The version number of the provider can be obtained using the method getVersion() in the class java.security.Provider. This method requires no parameter and it returns the version number of the provider as required.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("DSA");          Provider p = kpGenerator.getProvider();          System.out.println("The version number is: " + p.getVersion()); } catch (NoSuchAlgorithmException e) { ... Read More

Provider getName() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

150 Views

The name of the provider can be obtained using the getName() method in the class java.security.Provider. This method requires no parameter and it returns the name of the provider as required.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          KeyPairGenerator kpGenerator = KeyPairGenerator.getInstance("DSA");          Provider p = kpGenerator.getProvider();          System.out.println("The Provider is: " + p.getName());       } catch (NoSuchAlgorithmException e) { ... Read More

Provider getInfo() method in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

575 Views

An easily readable description of the provider and its services can be obtained using the method getInfo() in the class java.security.Provider. This method requires no parameters and it returns a provider and services description.A program that demonstrates this is given as follows −Example Live Demoimport 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:");          System.out.println(p.getInfo());       } catch ... Read More

Provider get() method in Java

karthikeya Boyini
Updated on 30-Jul-2019 22:30:25

397 Views

The value to which a key is mapped can be obtained using the get() method in the class java.security.Provider. This method requires a single parameter i.e. the key whose value is required. It returns the value to which the key is mapped or it returns null if there is no value to which the key is mapped.A program that demonstrates this is given as follows −Example Live Demoimport java.security.*; import java.util.*; public class Demo {    public static void main(String[] argv) {       try {          SecureRandom sRandom = SecureRandom.getInstance("SHA1PRNG");          Provider p ... Read More

Advertisements