public class BaseCipher extends Object implements Cipher
Cipher.Mode, Cipher.Utils
Constructor and Description |
---|
BaseCipher(int ivsize,
int bsize,
String algorithm,
String transformation) |
Modifier and Type | Method and Description |
---|---|
String |
getAlgorithm() |
int |
getBlockSize() |
int |
getIVSize() |
String |
getTransformation() |
void |
init(Cipher.Mode mode,
byte[] key,
byte[] iv)
Initialize the cipher for encryption or decryption with
the given key and initialization vector
|
protected static byte[] |
resize(byte[] data,
int size) |
String |
toString() |
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.
|
protected Cipher cipher
public String getAlgorithm()
getAlgorithm
in interface CipherInformation
public String getTransformation()
getTransformation
in interface CipherInformation
public int getIVSize()
getIVSize
in interface CipherInformation
public int getBlockSize()
getBlockSize
in interface CipherInformation
public void init(Cipher.Mode mode, byte[] key, byte[] iv) throws Exception
Cipher
public void update(byte[] input) throws Exception
Cipher
update
in interface Cipher
input
- The input/output bytesException
- If failed to executeCipher.update(byte[], int, int)
public void update(byte[] input, int inputOffset, int inputLen) throws Exception
Cipher
protected static byte[] resize(byte[] data, int size)
Copyright © 2008–2016 The Apache Software Foundation. All rights reserved.