Module io.github.mmm.crypto
Class SignatureProcessorImplWithHash
- java.lang.Object
-
- io.github.mmm.crypto.algorithm.AbstractSecurityAlgorithm
-
- io.github.mmm.crypto.asymmetric.sign.SignatureProcessorImplWithHash
-
- All Implemented Interfaces:
CryptoAlgorithm
,SignatureProcessor
,CryptoChunker
,CryptoProcessor
- Direct Known Subclasses:
SignatureSignerImplCryptorWithHash
,SignatureSignerImplWithHash
,SignatureVerifierImplCryptorWithHash
,SignatureVerifierImplWithHash
public abstract class SignatureProcessorImplWithHash extends AbstractSecurityAlgorithm implements SignatureProcessor
- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Constructor Summary
Constructors Constructor Description SignatureProcessorImplWithHash(HashCreator hashGenerator)
The constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description String
getAlgorithm()
protected HashCreator
getHashGenerator()
protected abstract CryptoAlgorithm
getSignatureAlgorithm()
void
reset()
Will reset the internal state of this object.void
update(byte[] input, int offset, int length)
-
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.CryptoChunker
update, update
-
Methods inherited from interface io.github.mmm.crypto.CryptoProcessor
process, process, process, process
-
-
-
-
Constructor Detail
-
SignatureProcessorImplWithHash
public SignatureProcessorImplWithHash(HashCreator hashGenerator)
The constructor.- Parameters:
hashGenerator
- theHashCreator
to apply as extension.
-
-
Method Detail
-
getSignatureAlgorithm
protected abstract CryptoAlgorithm getSignatureAlgorithm()
- Returns:
- the
CryptoAlgorithm
to extend.
-
getHashGenerator
protected HashCreator getHashGenerator()
- Returns:
- the
HashCreator
to apply as extension.
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceCryptoAlgorithm
- Returns:
- the name of the underlying algorithm (e.g. "RSA", "NONEwithECDSA", etc.).
- See Also:
Key.getAlgorithm()
,Signature.getAlgorithm()
,MessageDigest.getAlgorithm()
,SecureRandom.getAlgorithm()
,Cipher.getAlgorithm()
-
update
public void update(byte[] input, int offset, int length)
- Specified by:
update
in interfaceCryptoChunker
- Parameters:
input
- the next chunk of data.offset
- the index where to start reading data frominput
.length
- the number of bytes to read frominput
.- See Also:
MessageDigest.update(byte[], int, int)
,Signature.update(byte[], int, int)
-
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
- See Also:
MessageDigest.reset()
-
-