Module io.github.mmm.crypto
Class SignatureVerifierImplWithHash<S extends SignatureBinary>
- java.lang.Object
-
- io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
-
- io.github.mmm.crypto.asymmetric.sign.SignatureProcessorImplWithHash
-
- io.github.mmm.crypto.asymmetric.sign.SignatureVerifierImplWithHash<S>
-
- Type Parameters:
S- type ofSignatureBinary.
- All Implemented Interfaces:
CryptoAlgorithm,SignatureProcessor,SignatureVerifier<S>,SignatureVerifierSimple,CryptoChunker,CryptoProcessor
public class SignatureVerifierImplWithHash<S extends SignatureBinary> extends SignatureProcessorImplWithHash implements SignatureVerifier<S>
- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description SignatureVerifierImplWithHash(HashCreator hashGenerator, SignatureVerifier<S> verifier)The constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SignatureVerifier<S>getSignatureAlgorithm()voidreset()Will reset the internal state of this object.booleanverifyAfterUpdate(byte[] signature, int offset, int length)booleanverifyAfterUpdate(S signature)-
Methods inherited from class io.github.mmm.crypto.asymmetric.sign.SignatureProcessorImplWithHash
getAlgorithm, getHashGenerator, update
-
Methods inherited from class io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
creationFailedException, creationFailedException, creationFailedException, creationFailedException, getAlgorithm, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.github.mmm.crypto.algorithm.CryptoAlgorithm
getAlgorithm
-
Methods inherited from interface io.github.mmm.crypto.CryptoChunker
update, update, update
-
Methods inherited from interface io.github.mmm.crypto.CryptoProcessor
process, process, process, process
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.sign.SignatureVerifier
verify, verify, verify, verifyUnsafe
-
Methods inherited from interface io.github.mmm.crypto.asymmetric.sign.SignatureVerifierSimple
verify, verify, verify, verifyAfterUpdate
-
-
-
-
Constructor Detail
-
SignatureVerifierImplWithHash
public SignatureVerifierImplWithHash(HashCreator hashGenerator, SignatureVerifier<S> verifier)
The constructor.- Parameters:
hashGenerator- theHashCreatorto apply as extension.verifier- theSignatureVerifierto extend.
-
-
Method Detail
-
getSignatureAlgorithm
protected SignatureVerifier<S> getSignatureAlgorithm()
- Specified by:
getSignatureAlgorithmin classSignatureProcessorImplWithHash- Returns:
- the
CryptoAlgorithmto extend.
-
verifyAfterUpdate
public boolean verifyAfterUpdate(byte[] signature, int offset, int length)- Specified by:
verifyAfterUpdatein interfaceSignatureVerifierSimple- Parameters:
signature- thebytearray with the signature as raw data.offset- the index where to start reading data fromsignature.length- the number of bytes to read fromsignature.- Returns:
trueif the given signature is valid,falseotherwise.
-
verifyAfterUpdate
public boolean verifyAfterUpdate(S signature)
- Specified by:
verifyAfterUpdatein interfaceSignatureVerifier<S extends SignatureBinary>- Parameters:
signature- thebytearray with the signature as raw data.- Returns:
trueif the given signature is valid,falseotherwise.
-
reset
public void reset()
Description copied from interface:CryptoProcessorWill reset the internal state of this object. Please note that complex algorithms especially forCryptormay not reusable. It is therefore preferable to always create a fresh instance for each cryptographic task.- Specified by:
resetin interfaceCryptoProcessor- Overrides:
resetin classSignatureProcessorImplWithHash- See Also:
MessageDigest.reset()
-
-