Intel

Developer Zone

SequentialSignature


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 sign
dataIndex - index in the input array
dataLength - 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 signed
dataIndex - index in the input array
dataLength - 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 interface Signature
Parameters:
data - the input data to sign
dataIndex - index in the input array
dataLength - input data length
signature - an array to hold the output data
signatureIndex - 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 illegal
CryptoException

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 interface Signature
Parameters:
data - the input data that was signed
dataIndex - index in the input array
dataLength - input data length
signature - the signature to verify
signatureIndex - index in the signature array
signatureLength - 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 illegal
CryptoException