Found 34484 Articles for Programming

Provider keys() method in Java

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

77 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

Inspect live objects in Python

Nishtha Thakur
Updated on 30-Jul-2019 22:30:25

577 Views

Functions in this module provide usefule information about live objects such as modules, classes, methods, functions, code objects etc. These functions perform type checking, retrieve source code, inspect classes and functions, and examine the interpreter stack.getmembers()− This function returns all the members of an object in a list of name, value pairs sorted by name. If the optional predicate is supplied, only members for which the predicate returns a true value are included. getmodulename() −This function returns the name of the module named by the file path, without including the names of enclosing packagesWe shall be using following script for ... Read More

Provider getService() method in Java

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

222 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

282 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

110 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

Filtering Images based on size attributes in Python?

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:25

209 Views

Python provides multiple libraries for image processing including Pillow, Python Imaging library, scikit-image or OpenCV.We are going to use Pillow library for image processing here as it offers multiple standard procedures for image manipulation and supports the range of image file formats such as jpeg, png, gif, tiff, bmp and others.Pillow library is built on top of Python Imaging Library(PIL) and provides more features than its parent library(PIL).InstallationWe can install pillow using pip, so just type following in the command terminal −$ pip install pillowBasic operation on a pillowLet’s some basic operation on images using pillow library.from PIL import Image ... Read More

Provider getVersion() method in Java

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

165 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

Configuration file parser in Python (configparser)

Anvi Jain
Updated on 30-Jul-2019 22:30:25

12K+ Views

The configparser module from Python's standard library defines functionality for reading and writing configuration files as used by Microsoft Windows OS. Such files usually have .INI extension.The INI file consists of sections, each led by a [section] header. Between square brackets, we can put the section’s name. Section is followed by key/value entries separated by = or : character. It may include comments, prefixed by # or ; symbol. A sample INI file is shown below −[Settings] # Set detailed log for additional debugging info DetailedLog=1 RunStatus=1 StatusPort=6090 StatusRefresh=10 Archive=1 # Sets the location of the MV_FTP log file LogFile=/opt/ecs/mvuser/MV_IPTel/log/MV_IPTel.log ... Read More

Provider getName() method in Java

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

95 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

412 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

Advertisements