Some countries place legal restrictions on the
use of cryptographic algorithms. In some cases, a program may be
exempt from these restrictions if it implements an
"exemption mechanism" such as key
recovery, key escrow, or key weakening. This class defines a very
general API to such mechanism. This class is rarely used, and is not
supported in the default implementation provided by Sun. Using this
class successfully is quite complex, and is beyond the scope of this
reference. For details, see the discussion "How to
Make Applications `Exempt' from
Cryptographic Restrictions" in the JCE
Reference Guide which is part of the standard bundle of
documentation shipped by Sun with the JDK.
public class ExemptionMechanism {
// Protected Constructors
protected ExemptionMechanism(ExemptionMechanismSpi exmechSpi,
java.security.Provider provider, String mechanism);
// Public Class Methods
public static final ExemptionMechanism getInstance(String algorithm)
throws java.security.NoSuchAlgorithmException;
public static final ExemptionMechanism getInstance(String algorithm,
String provider) throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException;
public static final ExemptionMechanism getInstance(String algorithm,
java.security.Provider provider)
throws java.security.NoSuchAlgorithmException;
// Public Instance Methods
public final byte[ ] genExemptionBlob( ) throws IllegalStateException,
ExemptionMechanismException;
public final int genExemptionBlob(byte[ ] output)
throws IllegalStateException, ShortBufferException,
ExemptionMechanismException;
public final int genExemptionBlob(byte[ ] output, int outputOffset)
throws IllegalStateException, ShortBufferException,
ExemptionMechanismException;
public final String getName( );
public final int getOutputSize(int inputLen) throws IllegalStateException;
public final java.security.Provider getProvider( );
public final void init(java.security.Key key)
throws java.security.InvalidKeyException,
ExemptionMechanismException;
public final void init(java.security.Key key,
java.security.spec.AlgorithmParameterSpec params)
throws java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException,
ExemptionMechanismException;
public final void init(java.security.Key key,
java.security.AlgorithmParameters params)
throws java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException,
ExemptionMechanismException;
public final boolean isCryptoAllowed(java.security.Key key)
throws ExemptionMechanismException;
// Protected Methods Overriding Object
protected void finalize( );
}