public interface Cryptor extends CryptoProcessor, AbstractGetNonceSize
symmetric as well as
asymmetric encryption. Implementations are typically just
wrappers of Cipher. However this API is much more flexible, safe, and avoids many pitfalls. E.g.
multiple Ciphers can be combined without the need to change the code using the Cryptor.Decryptor,
Encryptor,
CryptorFactory| Modifier and Type | Method and Description |
|---|---|
default byte[] |
crypt(byte[] input,
boolean complete) |
byte[] |
crypt(byte[] input,
int offset,
int length,
boolean complete) |
default byte[] |
crypt(CryptoBinary input,
boolean complete) |
default byte[] |
doFinal() |
default byte[] |
process(byte[] input,
int offset,
int length,
boolean complete)
Generic method to process and transform data.
|
process, process, process, resetgetAlgorithmgetNonceSizedefault byte[] doFinal()
null.Cipher.doFinal()default byte[] crypt(byte[] input,
boolean complete)
input - the next chunk of data to encrypt or decrypt.complete - - true to complete the encryption or decryption in case this is the last chunk of data,
false otherwise.Cipher.update(byte[]),
Cipher.doFinal(byte[])default byte[] crypt(CryptoBinary input, boolean complete)
input - the next chunk of data to encrypt or decrypt.complete - - true to complete the encryption or decryption in case this is the last chunk of data,
false otherwise.Cipher.update(byte[]),
Cipher.doFinal(byte[])byte[] crypt(byte[] input,
int offset,
int length,
boolean complete)
input - the next chunk of data to encrypt or decrypt.offset - the offset where to start in the input array.length - the number of bytes to read from the input array.complete - - true to complete the encryption or decryption in case this is the last chunk of data,
false otherwise.output array.Cipher.update(byte[], int, int),
Cipher.doFinal(byte[], int, int)default byte[] process(byte[] input,
int offset,
int length,
boolean complete)
CryptoProcessorCryptoProcessor |
Equivalent of process(input, offset, length, complete) |
|---|---|
HashCreator |
|
Cryptor |
return |
SignatureSigner |
|
SignatureVerifier |
throw new |
process in interface CryptoProcessorinput - the data to process.offset - the index where to start reading data from input.length - the number of bytes to read from input.complete - - true to complete/reset this processor after processing the given input,
false otherwise.input data.Copyright © 2001–2019 mmm-Team. All rights reserved.