aicas logoJamaica 3.2 release 62

javax.crypto
Class ExemptionMechanism

java.lang.Object
  extended by javax.crypto.ExemptionMechanism

public class ExemptionMechanism
extends Object

An exemption mechanism, which will conditionally allow cryptography where it is not normally allowed, implements things such as key recovery, key weakening, or key escrow.

Implementation note: this class is present for API-compatibility only; it is not actually used anywhere in this library and this library does not, in general, support crypto weakening.

Since:
1.4

Constructor Summary
protected ExemptionMechanism(ExemptionMechanismSpi emSpi, Provider provider, String mechanism)
           
 
Method Summary
protected  void finalize()
          finalize may be called by the memory management of the virtual machine when it determined that this instance's memory is unreachable and can be reclaimed.
 byte[] genExemptionBlob()
           
 int genExemptionBlob(byte[] output)
           
 int genExemptionBlob(byte[] output, int outputOffset)
           
static ExemptionMechanism getInstance(String mechanism)
           
static ExemptionMechanism getInstance(String mechanism, Provider provider)
           
static ExemptionMechanism getInstance(String mechanism, String provider)
           
 String getName()
           
 int getOutputSize(int inputLength)
           
 Provider getProvider()
           
 void init(Key key)
           
 void init(Key key, AlgorithmParameters params)
           
 void init(Key key, AlgorithmParameterSpec params)
           
 boolean isCryptoAllowed(Key key)
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExemptionMechanism

protected ExemptionMechanism(ExemptionMechanismSpi emSpi,
                             Provider provider,
                             String mechanism)
Method Detail

getInstance

public static final ExemptionMechanism getInstance(String mechanism)
                                            throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

getInstance

public static final ExemptionMechanism getInstance(String mechanism,
                                                   String provider)
                                            throws NoSuchAlgorithmException,
                                                   NoSuchProviderException
Throws:
NoSuchAlgorithmException
NoSuchProviderException

getInstance

public static final ExemptionMechanism getInstance(String mechanism,
                                                   Provider provider)
                                            throws NoSuchAlgorithmException
Throws:
NoSuchAlgorithmException

genExemptionBlob

public final byte[] genExemptionBlob()
                              throws IllegalStateException,
                                     ExemptionMechanismException
Throws:
IllegalStateException
ExemptionMechanismException

genExemptionBlob

public final int genExemptionBlob(byte[] output)
                           throws IllegalStateException,
                                  ExemptionMechanismException,
                                  ShortBufferException
Throws:
IllegalStateException
ExemptionMechanismException
ShortBufferException

genExemptionBlob

public final int genExemptionBlob(byte[] output,
                                  int outputOffset)
                           throws IllegalStateException,
                                  ExemptionMechanismException,
                                  ShortBufferException
Throws:
IllegalStateException
ExemptionMechanismException
ShortBufferException

getName

public final String getName()

getOutputSize

public final int getOutputSize(int inputLength)
                        throws IllegalStateException
Throws:
IllegalStateException

getProvider

public final Provider getProvider()

init

public final void init(Key key)
                throws ExemptionMechanismException,
                       InvalidKeyException
Throws:
ExemptionMechanismException
InvalidKeyException

init

public final void init(Key key,
                       AlgorithmParameters params)
                throws ExemptionMechanismException,
                       InvalidAlgorithmParameterException,
                       InvalidKeyException
Throws:
ExemptionMechanismException
InvalidAlgorithmParameterException
InvalidKeyException

init

public final void init(Key key,
                       AlgorithmParameterSpec params)
                throws ExemptionMechanismException,
                       InvalidAlgorithmParameterException,
                       InvalidKeyException
Throws:
ExemptionMechanismException
InvalidAlgorithmParameterException
InvalidKeyException

isCryptoAllowed

public final boolean isCryptoAllowed(Key key)
                              throws ExemptionMechanismException
Throws:
ExemptionMechanismException

finalize

protected void finalize()
Description copied from class: Object
finalize may be called by the memory management of the virtual machine when it determined that this instance's memory is unreachable and can be reclaimed.

NOTE: The use of finalize() is strongly discouraged for realtime or safety-critical code. This method should only be used for debugging purposes. If used as a last resort to reclaim non-memory resouces, finalize() should indicate the resource leak with a loud error message.

There is no guarantee that finalize() will be called, the memory management may decide not to reclaim this object's memory or to delay the call to finalize() to an unspecified point in time. It is therefore recommended never to use the finalize method to release any resources (files, network connections, non-Java memory, etc.) since releasing of these resource may be delayed perpetually.

The order of finalization is not specified, i.e., the finalize method of any two objects that become unreachable may be called in an arbitrary order. It therefore has to be assumed that when finalize() is called on an object, that the finalize() method of any object that is only reachable through this object() has been called as well or is called simultaneously by another thread.

The presence of a finalize-method in any sub-class of Object causes the reclamation of the memory of this object to be delayed until the finalize() method has been executed. The finalize() method is typically executed by the finalizer thread (that may run at a low priority) or by a call to Runtime.runFinalization().

Any code sequence that creates instances of a class that defines a finalize() method must therefore ensure that sufficient CPU time is allocated to the finalizer thread or that Runtime.runFinalization() is called regularly such that the finalize() methods can be executed and the object's memory can be reclaimed.

The finalize method itself should never block or run for long times since it would otherwise block the finalizer thread or the thread that called Runtime.runFinalization() and prevent the execution other finalize() method and consequently prevent the reclamation of these object's memory.

For objects that are allocated in a javax.realtime.ScopedMemory, the finalize() methods will be called when this scoped memory is exited by the last thread. Unlike HeapMemory, which is controlled by the garbage collector, ScopedMemory provides a defined execution point for the finalize() mehods and it is therefore safer to use finalize() here.

Overrides:
finalize in class Object

aicas logoJamaica 3.2 release 62

aicas GmbH, Karlsruhe - Germany    www.aicas.com
Copyright 2001-2008 aicas GmbH. All Rights Reserved.