The Provider Class

The first class we’ll examine in depth is the Provider class (java.security.Provider).

public abstract class Provider extends Properties

This class forms the basis of the security provider architecture. There is normally a standard subclass that implements a default security feature set; other classes can be installed to implement other security algorithms.

In the core Java API, the Provider class is abstract and there are no classes in the core Java API that extend the Provider class. The default provider class that comes with Sun’s implementation of Java is the class Sun in the sun.security.provider package. However, since this class is in the sun package, there’s no guarantee that it will be available with every implementation of the Java virtual machine; other implementations may supply a different provider.

In theory, this should not matter. The concepts of the security package will work according to the specification as long as the Java implementation provides an appropriate provider class and appropriate classes to perform the operations a Java program will expect. The exact set of classes a particular program may expect will depend, of course, on the program. In the next section, we’ll discuss how different implementations of the Provider class may be loaded and used during the execution of the virtual machine.

Using the Provider Class

The Provider class is seldom used directly by a programmer. This class does contain a number of useful miscellaneous ...

Get Java Security, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.