javax.crypto
Class ExemptionMechanismSpi

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

public abstract class ExemptionMechanismSpi
extends Object

The Service Provider Interface (SPI) for the ExemptionMechanism class.

Since:
1.4

Constructor Summary
ExemptionMechanismSpi()
          Create a new exemption mechanism SPI.
 
Method Summary
protected abstract  byte[] engineGenExemptionBlob()
          Return a key blob for the key that this mechanism was initialized with.
protected abstract  int engineGenExemptionBlob(byte[] output, int outputOffset)
          Generate a key blob for the key that this mechanism was initialized with, storing it into the given byte array.
protected abstract  int engineGetOutputSize(int inputLength)
          Get the size of the output blob given an input key size.
protected abstract  void engineInit(Key key)
          Initialize this mechanism with a key.
protected abstract  void engineInit(Key key, AlgorithmParameters params)
          Initialize this mechanism with a key and parameters.
protected abstract  void engineInit(Key key, AlgorithmParameterSpec params)
          Initialize this mechanism with a key and parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExemptionMechanismSpi

public ExemptionMechanismSpi()
Create a new exemption mechanism SPI.

Method Detail

engineGenExemptionBlob

protected abstract byte[] engineGenExemptionBlob()
                                          throws ExemptionMechanismException
Return a key blob for the key that this mechanism was initialized with.

Returns:
The key blob.
Throws:
ExemptionMechanismException - If generating the blob fails.

engineGenExemptionBlob

protected abstract int engineGenExemptionBlob(byte[] output,
                                              int outputOffset)
                                       throws ExemptionMechanismException,
                                              ShortBufferException
Generate a key blob for the key that this mechanism was initialized with, storing it into the given byte array.

Parameters:
output - The destination for the key blob.
outputOffset - The index in the output array to start.
Returns:
The size of the key blob.
Throws:
ExemptionMechanismException - If generating the blob fails.
ShortBufferException - If the output array is not large enough for the key blob.

engineGetOutputSize

protected abstract int engineGetOutputSize(int inputLength)
Get the size of the output blob given an input key size. The actual blob may be shorter than the value returned by this method. Both values are in bytes.

Parameters:
inputLength - The input size.
Returns:
The output size.

engineInit

protected abstract void engineInit(Key key)
                            throws ExemptionMechanismException,
                                   InvalidKeyException
Initialize this mechanism with a key.

Parameters:
key - The key.
Throws:
ExemptionMechanismException - If generating the blob fails.
InvalidKeyException - If the supplied key cannot be used.

engineInit

protected abstract void engineInit(Key key,
                                   AlgorithmParameters params)
                            throws ExemptionMechanismException,
                                   InvalidAlgorithmParameterException,
                                   InvalidKeyException
Initialize this mechanism with a key and parameters.

Parameters:
key - The key.
params - The parameters.
Throws:
ExemptionMechanismException - If generating the blob fails.
java.security.InvalidAlgorithmParameterExceptin - If the supplied parameters are inappropriate.
InvalidKeyException - If the supplied key cannot be used.
InvalidAlgorithmParameterException

engineInit

protected abstract void engineInit(Key key,
                                   AlgorithmParameterSpec params)
                            throws ExemptionMechanismException,
                                   InvalidAlgorithmParameterException,
                                   InvalidKeyException
Initialize this mechanism with a key and parameters.

Parameters:
key - The key.
params - The parameters.
Throws:
ExemptionMechanismException - If generating the blob fails.
java.security.InvalidAlgorithmParameterExceptin - If the supplied parameters are inappropriate.
InvalidKeyException - If the supplied key cannot be used.
InvalidAlgorithmParameterException