In this section, we’ll look into how the Java VM locates the
security provider(s) we want to use. The
java.security.Security) is responsible
for managing the set of provider classes that a Java program can use
and forms the last link in the architecture of the security provider.
This class is final, and all its methods are
static (except for its constructor, which
is private). Like the
Math classes, then, the
Security class can never be created or
subclassed; it exists simply to provide a placeholder for methods
that deal with the
Earlier, we explained how to add entries to the
java.security file to add new providers to the
security architecture. The same feat can be accomplished
programmatically via these methods of the
Add a new provider into the list of providers. The provider is added to the end of the internal array of providers.
Add a new provider into the internal array of providers. The provider is added at the specified position; other providers have their index changed if necessary to make room for this provider. Position counting begins at 1.
The notion that these classes are kept in an indexed array is
important; when the
class is asked to provide a particular algorithm for an operation, the array is searched sequentially for a provider that can supply the ...