Package javax.crypto
Class ExemptionMechanismSpi
java.lang.Object
javax.crypto.ExemptionMechanismSpi
public abstract class ExemptionMechanismSpi extends Object
The Service Provider Interface (SPI) definition for the
ExemptionMechanism class.-
Constructor Summary
Constructors Constructor Description ExemptionMechanismSpi()Creates a newExemptionMechanismSpiinstance. -
Method Summary
Modifier and Type Method Description protected abstract byte[]engineGenExemptionBlob()Generates the result key blob for this exemption mechanism.protected abstract intengineGenExemptionBlob(byte[] output, int outputOffset)Generates the result key blob for this exemption mechanism and stores it into theoutputbuffer at offsetoutputOffset.protected abstract intengineGetOutputSize(int inputLen)Returns the size in bytes for the output buffer needed to hold the output of the nextengineGenExemptionBlob()call, given the specifiedinputLen(in bytes).protected abstract voidengineInit(Key key)Initializes thisExemptionMechanisminstance with the specified key.protected abstract voidengineInit(Key key, AlgorithmParameters params)Initializes thisExemptionMechanisminstance with the specified key and algorithm parameters.protected abstract voidengineInit(Key key, AlgorithmParameterSpec params)Initializes thisExemptionMechanisminstance with the specified key and algorithm parameters.
-
Constructor Details
-
ExemptionMechanismSpi
public ExemptionMechanismSpi()Creates a newExemptionMechanismSpiinstance.
-
-
Method Details
-
engineGenExemptionBlob
Generates the result key blob for this exemption mechanism.- Returns:
- the result key blob for this exemption mechanism.
- Throws:
ExemptionMechanismException- if error(s) occur during generation.
-
engineGenExemptionBlob
protected abstract int engineGenExemptionBlob(byte[] output, int outputOffset) throws ShortBufferException, ExemptionMechanismExceptionGenerates the result key blob for this exemption mechanism and stores it into theoutputbuffer at offsetoutputOffset.- Parameters:
output- the output buffer for the result key blob.outputOffset- the offset in the output buffer to start.- Returns:
- the number of bytes written to the
outputbuffer. - Throws:
ShortBufferException- if the provided buffer is too small for the result key blob.ExemptionMechanismException- if error(s) occur during generation.
-
engineGetOutputSize
protected abstract int engineGetOutputSize(int inputLen)Returns the size in bytes for the output buffer needed to hold the output of the nextengineGenExemptionBlob()call, given the specifiedinputLen(in bytes).- Parameters:
inputLen- the specified input length (in bytes).- Returns:
- the size in bytes for the output buffer.
-
engineInit
protected abstract void engineInit(Key key) throws InvalidKeyException, ExemptionMechanismExceptionInitializes thisExemptionMechanisminstance with the specified key.- Parameters:
key- the key to initialize this instance with.- Throws:
InvalidKeyException- if the key cannot be used to initialize this mechanism.ExemptionMechanismException- if error(s) occur during initialization.
-
engineInit
protected abstract void engineInit(Key key, AlgorithmParameters params) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismExceptionInitializes thisExemptionMechanisminstance with the specified key and algorithm parameters.- Parameters:
key- the key to initialize this instance with.params- the parameters for this exemption mechanism algorithm.- Throws:
InvalidKeyException- if the key cannot be used to initialize this mechanism.InvalidAlgorithmParameterException- if the parameters cannot be used to initialize this mechanism.ExemptionMechanismException- if error(s) occur during initialization.
-
engineInit
protected abstract void engineInit(Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException, ExemptionMechanismExceptionInitializes thisExemptionMechanisminstance with the specified key and algorithm parameters.- Parameters:
key- the key to initialize this instance with.params- the parameters for this exemption mechanism algorithm.- Throws:
InvalidKeyException- if the key cannot be used to initialize this mechanism.InvalidAlgorithmParameterException- the the parameters cannot be used to initialize this mechanism.ExemptionMechanismException- if error(s) occur during initialization.
-