Package eu.europa.esig.dss.spi
Class DSSMessageDigestCalculator
java.lang.Object
eu.europa.esig.dss.spi.DSSMessageDigestCalculator
This class is used to compute
DSSMessageDigest
based on the provided input-
Constructor Summary
ConstructorDescriptionDSSMessageDigestCalculator
(DigestAlgorithm digestAlgorithm) Default constructor -
Method Summary
Modifier and TypeMethodDescriptionReturns theDSSMessageDigest
accordingly to the current state.void
update
(byte byteToAdd) Updates the digest using the provided bytevoid
update
(byte[] bytes) Updates the digest using the provided array of bytesvoid
update
(InputStream inputStream) Updates the digest by reading the providedInputStream
.
-
Constructor Details
-
DSSMessageDigestCalculator
Default constructor- Parameters:
digestAlgorithm
-DigestAlgorithm
to be used for message-digest computation
-
-
Method Details
-
update
public void update(byte byteToAdd) Updates the digest using the provided byte- Parameters:
byteToAdd
- byte to be added for digest computation
-
update
public void update(byte[] bytes) Updates the digest using the provided array of bytes- Parameters:
bytes
- array of bytes
-
update
Updates the digest by reading the providedInputStream
. NOTE: the method consumes theInputStream
, and closes it after.- Parameters:
inputStream
-InputStream
- Throws:
IOException
- if an error is thrown on InputStream reading
-
getMessageDigest
Returns theDSSMessageDigest
accordingly to the current state. This method resets the state of message-digest.- Returns:
DSSMessageDigest
-