Intel

Developer Zone

Signature


com.intel.crypto
Interface Signature

All Known Subinterfaces:
SequentialSignature
All Known Implementing Classes:
EpidAlg, RsaAlg, SymmetricSignatureAlg

public interface Signature

This interface represents a signature algorithm. This interface supports only stateless operations where all data is processed in one method call.

See Also:
SequentialSignature

Method Summary
short getSignatureLength()
Returns the length of the signature generated by this instance.
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.
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.

Method Detail

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.

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:
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.

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:
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

getSignatureLength

short getSignatureLength()
                         throws CryptoException
Returns the length of the signature generated by this instance.

Returns:
Signature length in bytes.
Throws:
NotInitializedException - if this instance is not configured correctly in order to calculate the signature size. For example, for RSA signatures the key is not set.
CryptoException