public interface Cipher extends CipherInformation
Modifier and Type | Interface and Description |
---|---|
static class |
Cipher.Mode |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkSupported(String xform,
int keyLength) |
void |
init(Cipher.Mode mode,
byte[] key,
byte[] iv)
Initialize the cipher for encryption or decryption with
the given key and initialization vector
|
default void |
update(byte[] input)
Performs in-place encryption or decryption on the given data.
|
void |
update(byte[] input,
int inputOffset,
int inputLen)
Performs in-place encryption or decryption on the given data.
|
getCipherBlockSize, getIVSize, getKdfSize, getTransformation
getAlgorithm
getKeySize
void init(Cipher.Mode mode, byte[] key, byte[] iv) throws Exception
mode
- Encrypt/Decrypt initializationkey
- Key bytesiv
- Initialization vector bytesException
- If failed to initializedefault void update(byte[] input) throws Exception
input
- The input/output bytesException
- If failed to executeupdate(byte[], int, int)
void update(byte[] input, int inputOffset, int inputLen) throws Exception
input
- The input/output bytesinputOffset
- The offset of the data in the data bufferinputLen
- The number of bytes to update - starting at the given offsetException
- If failed to executestatic boolean checkSupported(String xform, int keyLength)
xform
- The full cipher transformation - e.g., AES/CBC/NoPadding -
never null
/emptykeyLength
- The required key length in bits - always positivetrue
if the cipher transformation and required
key length are supportedCipher.getMaxAllowedKeyLength(String)
Copyright © 2008–2022 The Apache Software Foundation. All rights reserved.