Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
xjava.security.IJCE
public class IJCE
extends java.lang.Object
Method Summary | |
(package private) static void |
|
static void |
|
static boolean |
|
static boolean |
|
(package private) static void |
|
static Target |
|
static Target |
|
static String[] |
|
static String[] |
|
(package private) static int |
|
(package private) static PrintWriter |
|
static Object |
|
static Object |
|
static Class |
|
static Class |
|
static int |
|
static int |
|
static int |
|
static String |
|
static String |
|
static String |
|
static boolean |
|
static boolean |
|
static boolean |
|
(package private) static void |
|
static void |
|
(package private) static void |
|
(package private) static void debug(String s)
Prints a debugging message that may be significant to a developer.
public static void disableTracing(Object obj)
Disables tracing of SPI methods for obj. Returns silently if tracing was not enabled or is not supported for this object.
public static boolean enableTracing(Object obj)
Enables tracing of calls to SPI methods for the algorithm object obj, with Output sent to the default location, given bygetDebugOutput()
.
public static boolean enableTracing(Object obj, PrintWriter out)
Enables tracing of calls to SPI methods for the algorithm object obj. Output is sent to the PrintWriter out. This method will return true if tracing was enabled successfully, or false if it is not supported for this class. Some trivial methods (such as those that get the block size) are not traced. This can produce a lot of Output, and it should only be used for debugging, when the data being processed by the algorithm object is not secret. Tracing only works for classes whose implementations are being provided by IJCE. If there is a non-IJCE implementation of the base class for obj (Cipher, MessageDigest, etc.) earlier in the CLASSPATH, it will probably not support tracing, and false will be returned. Note that the IJCE library includes an implementation of java.io.PrintWriter that will be used automatically when running on Java 1.0.2.
(package private) static void error(String s)
Prints an error message that may be significant to a user.
public static Target findTarget(String name) throws ForbiddenTargetException
Returns a Target that can be passed toPrivilegeManager.enablePrivilege(...)
, in order to request permission for an action that requires the user's trust. Currently the following target names are recognized:
- AddSecurityProvider - add a new security provider to the system.
- RemoveSecurityProvider - remove a security provider from the system.
- SecurityPropertyRead - read the security properties.
- SecurityPropertyWrite - change the value of any security property.
- GetSecurityProviders - get a reference to any security Provider object.
- Parameters:
name
- the name of the target to be returned
- Returns:
- the Target object
- Throws:
ForbiddenTargetException
- if name is not recognized.
public static Target findTarget(String name, Object arg) throws ForbiddenTargetException
Reserved for future use, in case parameterized targets are needed. Currently this always throws a ForbiddenTargetException.
- Parameters:
name
- the name of the target to be returnedarg
- a parameter object
- Returns:
- the Target object
- Throws:
ForbiddenTargetException
- if name is not recognized.
public static String[] getAlgorithms(Provider provider, String type)
Gets the standard names of all algorithms of the given type implemented by a provider. Possible values for type include "Cipher", "Mode", "PaddingScheme", "MessageDigest", "Signature", "KeyGenerator", and "KeyPairGenerator". Other types can be configured in the IJCE.properties file.
public static String[] getAlgorithms(String type)
Gets the standard names of all algorithms of the given type implemented by any installed provider. Algorithm names are not duplicated if they are supported by more than one provider (but specialized cipher/mode implementations are treated as distinct, for example "DES/CBC" is different from "DES"). Possible values for type include "Cipher", "Mode", "PaddingScheme", "MessageDigest", "Signature", "KeyGenerator", and "KeyPairGenerator". Other types can be configured in the IJCE.properties file. The built-in padding scheme "NONE", or the built-in mode "ECB" are included if applicable.
(package private) static int getDebugLevel(String label)
Returns the debug level for label. Its value is normally given by the numeric provider property "Debug.Level.label
". If this property is not set, "Debug.Level.*
" is searched next. If neither property is set, or if the first property found is not a valid decimal integer, then this method returns 0.
(package private) static PrintWriter getDebugOutput()
Returns the PrintWriter that debugging Output is to be sent to.
public static Object getImplementation(String algorithm, String type) throws NoSuchAlgorithmException
Returns an object configured to the specified type. All providers will be searched in order of preference. Possible values for type include "Cipher", "Mode", "PaddingScheme", "MessageDigest", "Signature", "KeyGenerator", and "KeyPairGenerator". Other types can be configured in the IJCE.properties file.
- Parameters:
algorithm
- the standard name or an alias for the algorithm.type
- the type of algorithm.
- Returns:
- the implementation object.
public static Object getImplementation(String algorithm, String provider, String type) throws NoSuchAlgorithmException, NoSuchProviderException
Returns an object configured to the specified type. Provider can be null, in which case all providers will be searched in order of preference. Possible values for type include "Cipher", "Mode", "PaddingScheme", "MessageDigest", "Signature", "KeyGenerator", and "KeyPairGenerator". Other types can be configured in the IJCE.properties file.
- Parameters:
algorithm
- the standard name or an alias for the algorithm.provider
- the string name of the provider.type
- the type of algorithm.
- Returns:
- the implementation object.
public static Class getImplementationClass(String algorithm, String type) throws NoSuchAlgorithmException
Given an algorithm name (which may be an alias) and type, returns the corresponding algorithm class from any provider.
public static Class getImplementationClass(String algorithm, String provider, String type) throws NoSuchAlgorithmException, NoSuchProviderException
Given an algorithm name (which may be an alias), a provider name, and a type, returns the corresponding algorithm class.
public static int getIntermediateVersion()
Returns the intermediate version of this release of IJCE.
public static int getMajorVersion()
Returns the major version of this release of IJCE.
public static int getMinorVersion()
Returns the minor version of this release of IJCE.
public static String getReleaseDate()
Returns the release date of this version of IJCE, as a string in the form "yyyy/mm/dd".
public static String getStandardName(String algorithm, String type)
Expands the possible alias algorithm to a standard name. If algorithm is not an alias, it is returned as-is. This method does not check whether a corresponding algorithm implementation exists. Possible values for type include "Cipher", "Mode", "PaddingScheme", "MessageDigest", "Signature", "KeyGenerator", and "KeyPairGenerator". Other types can be configured in the IJCE.properties file.
- Parameters:
algorithm
- the possible aliastype
- the type of algorithm
- Returns:
- the standard name
public static String getVersionString()
Returns a string describing this version of IJCE.
public static boolean isProvidingJCA()
Returns true if IJCE is providing the implementations of the JCA classes (MessageDigest, Signature, etc). This will be false if another version of JCA (for example JavaSoft's) is installed earlier in the CLASSPATH.
public static boolean isProvidingJCE()
Returns true if IJCE is providing the implementations of the JCE classes (Cipher, KeyGenerator, etc). This will be false if another version of JCE (for example JavaSoft's) is installed earlier in the CLASSPATH.
public static boolean isVersionAtLeast(int major, int minor, int intermediate)
Returns true iff this version of IJCE is at least the given version.
(package private) static void listProviders()
Debugging method to list all providers.
public static void main(String[] args)
Prints the IJCE version string, a list of statically configured providers, and the location of the library directory.
(package private) static void reportBug(String s)
Prints a "can't happen" error, with a request to report this as a bug. Always throws an InternalError.