|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.crypto.ExemptionMechanism
public class ExemptionMechanism
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.
| 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 |
|---|
protected ExemptionMechanism(ExemptionMechanismSpi emSpi,
Provider provider,
String mechanism)
| Method Detail |
|---|
public static final ExemptionMechanism getInstance(String mechanism)
throws NoSuchAlgorithmException
NoSuchAlgorithmException
public static final ExemptionMechanism getInstance(String mechanism,
String provider)
throws NoSuchAlgorithmException,
NoSuchProviderException
NoSuchAlgorithmException
NoSuchProviderException
public static final ExemptionMechanism getInstance(String mechanism,
Provider provider)
throws NoSuchAlgorithmException
NoSuchAlgorithmException
public final byte[] genExemptionBlob()
throws IllegalStateException,
ExemptionMechanismException
IllegalStateException
ExemptionMechanismException
public final int genExemptionBlob(byte[] output)
throws IllegalStateException,
ExemptionMechanismException,
ShortBufferException
IllegalStateException
ExemptionMechanismException
ShortBufferException
public final int genExemptionBlob(byte[] output,
int outputOffset)
throws IllegalStateException,
ExemptionMechanismException,
ShortBufferException
IllegalStateException
ExemptionMechanismException
ShortBufferExceptionpublic final String getName()
public final int getOutputSize(int inputLength)
throws IllegalStateException
IllegalStateExceptionpublic final Provider getProvider()
public final void init(Key key)
throws ExemptionMechanismException,
InvalidKeyException
ExemptionMechanismException
InvalidKeyException
public final void init(Key key,
AlgorithmParameters params)
throws ExemptionMechanismException,
InvalidAlgorithmParameterException,
InvalidKeyException
ExemptionMechanismException
InvalidAlgorithmParameterException
InvalidKeyException
public final void init(Key key,
AlgorithmParameterSpec params)
throws ExemptionMechanismException,
InvalidAlgorithmParameterException,
InvalidKeyException
ExemptionMechanismException
InvalidAlgorithmParameterException
InvalidKeyException
public final boolean isCryptoAllowed(Key key)
throws ExemptionMechanismException
ExemptionMechanismExceptionprotected void finalize()
ObjectNOTE: 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.
finalize in class Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||