javax.crypto

Class ExemptionMechanismSpi

public abstract class ExemptionMechanismSpi extends Object

The Service Provider Interface (SPI) for the {@link 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 intengineGenExemptionBlob(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 intengineGetOutputSize(int inputLength)
Get the size of the output blob given an input key size.
protected abstract voidengineInit(Key key)
Initialize this mechanism with a key.
protected abstract voidengineInit(Key key, AlgorithmParameters params)
Initialize this mechanism with a key and parameters.
protected abstract voidengineInit(Key key, AlgorithmParameterSpec params)
Initialize this mechanism with a key and parameters.

Constructor Detail

ExemptionMechanismSpi

public ExemptionMechanismSpi()
Create a new exemption mechanism SPI.

Method Detail

engineGenExemptionBlob

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

Returns: The key blob.

Throws: javax.crypto.ExemptionMechanismException If generating the blob fails.

engineGenExemptionBlob

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.

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: javax.crypto.ExemptionMechanismException If generating the blob fails. javax.crypto.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)
Initialize this mechanism with a key.

Parameters: key The key.

Throws: javax.crypto.ExemptionMechanismException If generating the blob fails. java.security.InvalidKeyException If the supplied key cannot be used.

engineInit

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

Parameters: key The key. params The parameters.

Throws: javax.crypto.ExemptionMechanismException If generating the blob fails. java.security.InvalidAlgorithmParameterExceptin If the supplied parameters are inappropriate. java.security.InvalidKeyException If the supplied key cannot be used.

engineInit

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

Parameters: key The key. params The parameters.

Throws: javax.crypto.ExemptionMechanismException If generating the blob fails. java.security.InvalidAlgorithmParameterExceptin If the supplied parameters are inappropriate. java.security.InvalidKeyException If the supplied key cannot be used.