com.intel.crypto
Interface Signature
-
- All Known Subinterfaces:
- SequentialSignature
- All Known Implementing Classes:
- EpidAlg, EpidAlgEx, 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
Methods Modifier and Type Method and Description 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 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:
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
- if some unexpected error has occurred
-
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 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:
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
- if some unexpected error has occurred
-
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, a required key is not set.CryptoException
- if some unexpected error has occurred
-
-