com.intel.crypto
Interface SequentialSignature
- All Superinterfaces:
- Signature
- All Known Implementing Classes:
- SymmetricSignatureAlg
public interface SequentialSignature
- extends Signature
This interface is an extension to the basic signature interface.
This interface adds support for sequential operations, where the data is processed
in chunks by calling the interface several times (see the signUpdate
and
verifyUpdate
methods).
Method Summary | |
---|---|
short |
signComplete(byte[] data,
short dataIndex,
short dataLength,
byte[] signature,
short signatureIndex)
Signs the provided input data using the key currently stored by the instance. |
void |
signUpdate(byte[] data,
short dataIndex,
short dataLength)
Signs the provided input data, using the key currently stored by the instance, and maintains the instance state for the next operation. |
boolean |
verifyComplete(byte[] data,
short dataIndex,
short dataLength,
byte[] signature,
short signatureIndex,
short signatureLength)
Verifies the signature on the provided input data using the key currently stored by the instance. |
void |
verifyUpdate(byte[] data,
short dataIndex,
short dataLength)
Verifies the signature on the provided input data, using the key currently stored by the instance, and maintains the instance state for the next operation. |
Methods inherited from interface com.intel.crypto.Signature |
---|
getSignatureLength |
Method Detail |
---|
signUpdate
void signUpdate(byte[] data, short dataIndex, short dataLength) throws CryptoException
- Signs the provided input data, using the key currently stored by the instance,
and maintains the instance state for the next operation.
The
signComplete
method must be called to complete the signing operations sequence and clear the internal state maintained by the instance.- Parameters:
data
- the input data to signdataIndex
- index in the input arraydataLength
- input data length- Throws:
NotInitializedException
- if this instance is not configured correctly in order to generate a signature. For example, the key with which to sign the data is not set.CryptoException
verifyUpdate
void verifyUpdate(byte[] data, short dataIndex, short dataLength) throws CryptoException
- Verifies the signature on the provided input data, using the key currently stored by the instance,
and maintains the instance state for the next operation.
The
verifyComplete
method must be called to complete the verify operations sequence and receive the verification result.- Parameters:
data
- the input data that was signeddataIndex
- index in the input arraydataLength
- input data length- Throws:
NotInitializedException
- if this instance is not configured correctly in order to verify the signature. For example, the key the data was signed with is not set.CryptoException
signComplete
short signComplete(byte[] data, short dataIndex, short dataLength, byte[] signature, short signatureIndex) throws CryptoException
- Signs the provided input data using the key currently stored by the instance.
- Specified by:
signComplete
in interfaceSignature
- Parameters:
data
- the input data to signdataIndex
- index in the input arraydataLength
- input data lengthsignature
- an array to hold the output datasignatureIndex
- index in the output array- Returns:
- The number of bytes written into the signature array.
- Throws:
IllegalUseException
- if this method is not used correctly (for example, when no input data is provided via this method or the update methods)NotInitializedException
- if this instance is not configured correctly in order to generate a signature. For example, the key required for signing the data is not set.IllegalParameterException
- if the data provided for signing is illegalCryptoException
verifyComplete
boolean verifyComplete(byte[] data, short dataIndex, short dataLength, byte[] signature, short signatureIndex, short signatureLength) throws CryptoException
- Verifies the signature on the provided input data using the key currently stored by the instance.
- Specified by:
verifyComplete
in interfaceSignature
- Parameters:
data
- the input data that was signeddataIndex
- index in the input arraydataLength
- input data lengthsignature
- the signature to verifysignatureIndex
- index in the signature arraysignatureLength
- signature length- Returns:
true
if the signature verified successfully,false
otherwise.- Throws:
IllegalUseException
- if this method is not used correctly (for example, when no input data is provided via this method or the update methods)NotInitializedException
- if this instance is not configured correctly in order to verify the signature. For example, the key required for verifying the signature is not set.IllegalParameterException
- if the data provided for verification is illegalCryptoException