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()
void
reset()
Will reset the internal state of this object.boolean
verifyAfterUpdate(byte[] signature, int offset, int length)
boolean
verifyAfterUpdate(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
- theHashCreator
to apply as extension.verifier
- theSignatureVerifier
to extend.
-
-
Method Detail
-
getSignatureAlgorithm
protected SignatureVerifier<S> getSignatureAlgorithm()
- Specified by:
getSignatureAlgorithm
in classSignatureProcessorImplWithHash
- Returns:
- the
CryptoAlgorithm
to extend.
-
verifyAfterUpdate
public boolean verifyAfterUpdate(byte[] signature, int offset, int length)
- Specified by:
verifyAfterUpdate
in interfaceSignatureVerifierSimple
- Parameters:
signature
- thebyte
array with the signature as raw data.offset
- the index where to start reading data fromsignature
.length
- the number of bytes to read fromsignature
.- Returns:
true
if the given signature is valid,false
otherwise.
-
verifyAfterUpdate
public boolean verifyAfterUpdate(S signature)
- Specified by:
verifyAfterUpdate
in interfaceSignatureVerifier<S extends SignatureBinary>
- Parameters:
signature
- thebyte
array with the signature as raw data.- Returns:
true
if the given signature is valid,false
otherwise.
-
reset
public void reset()
Description copied from interface:CryptoProcessor
Will reset the internal state of this object. Please note that complex algorithms especially forCryptor
may not reusable. It is therefore preferable to always create a fresh instance for each cryptographic task.- Specified by:
reset
in interfaceCryptoProcessor
- Overrides:
reset
in classSignatureProcessorImplWithHash
- See Also:
MessageDigest.reset()
-
-