-
- All Superinterfaces:
CryptoAlgorithm
- All Known Subinterfaces:
AbstractDecryptor,AbstractEncryptor,CryptoChunker,Cryptor,Decryptor,Encryptor,HashCreator,SignatureProcessor,SignatureSigner<S>,SignatureSignerSimple,SignatureVerifier<S>,SignatureVerifierSimple
- All Known Implementing Classes:
CryptorImplCipher,CryptorImplCombined,DecryptorImplCipher,DecryptorImplCombined,EncryptorImplCiper,EncryptorImplCombined,HashCreatorImplCombined,HashCreatorImplDigest,HashCreatorImplMultipleRounds,SignatureProcessorImpl,SignatureProcessorImplEcBc,SignatureProcessorImplWithHash,SignatureSignerImpl,SignatureSignerImplCryptorWithHash,SignatureSignerImplEcBc,SignatureSignerImplWithHash,SignatureVerifierImpl,SignatureVerifierImplCryptorWithHash,SignatureVerifierImplEcBc,SignatureVerifierImplWithHash
public interface CryptoProcessor extends CryptoAlgorithm
The abstract interface for any object that is based on a securityalgorithm.- Since:
- 1.0.0
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default byte[]process(byte[] input)Generic method to process and transform data.default byte[]process(byte[] input, int offset, int length)Generic method to process and transform data.default byte[]process(byte[] input, int offset, int length, boolean complete)Generic method to process and transform data.default byte[]process(CryptoBinary input, boolean complete)voidreset()Will reset the internal state of this object.-
Methods inherited from interface io.github.mmm.crypto.algorithm.CryptoAlgorithm
getAlgorithm
-
-
-
-
Method Detail
-
process
default byte[] process(byte[] input)
Generic method to process and transform data.CryptoProcessorEquivalent of process(input)HashCreatorupdate(input); returnhash(true);Cryptorreturncrypt(input, true);SignatureSignerupdate(input); returnsignAfterUpdateRaw(true);SignatureVerifierthrow newUnsupportedOperationException();- Parameters:
input- the data to process.- Returns:
- the transformed
inputdata.
-
process
default byte[] process(byte[] input, int offset, int length)Generic method to process and transform data.CryptoProcessorEquivalent of process(input, offset, length)HashCreatorupdate(input, offset, length); returnhash(true);Cryptorreturncrypt(input, offset, length, true);SignatureSignerupdate(input, offset, length); returnsignAfterUpdate(true);SignatureVerifierthrow newUnsupportedOperationException();- Parameters:
input- the data to process.offset- the index where to start reading data frominput.length- the number of bytes to read frominput.- Returns:
- the transformed
inputdata.
-
process
default byte[] process(byte[] input, int offset, int length, boolean complete)Generic method to process and transform data.CryptoProcessorEquivalent of process(input, offset, length, complete)HashCreatorupdate(input, offset, length); returnhash(complete);Cryptorreturncrypt(input, offset, length, true);SignatureSignerupdate(input, offset, length); returnsignAfterUpdate(complete);SignatureVerifierthrow newUnsupportedOperationException();- Parameters:
input- the data to process.offset- the index where to start reading data frominput.length- the number of bytes to read frominput.complete- -trueto complete/reset this processor after processing the giveninput,falseotherwise.- Returns:
- the transformed
inputdata.
-
process
default byte[] process(CryptoBinary input, boolean complete)
- Parameters:
input- theCryptoBinarycontaining the datato process.complete- -trueto complete/reset this processor after processing the giveninput,falseotherwise.- Returns:
- the transformed
inputdata. - See Also:
process(byte[])
-
reset
void reset()
Will 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.- See Also:
MessageDigest.reset()
-
-