public abstract class BaseCipher extends java.lang.Object implements Cipher
Cipher.Mode| Constructor and Description |
|---|
BaseCipher(int ivsize,
int bsize,
java.lang.String algorithm,
java.lang.String transformation) |
| Modifier and Type | Method and Description |
|---|---|
int |
getBlockSize() |
int |
getIVSize() |
protected javax.crypto.spec.SecretKeySpec |
getKeySpec(byte[] key) |
protected int |
getMode(Cipher.Mode mode) |
void |
init(Cipher.Mode mode,
byte[] key,
byte[] iv)
Initialize the cipher for encryption or decryption with the given private key and initialization vector
|
protected abstract void |
initCipher(javax.crypto.Cipher cipher,
Cipher.Mode mode,
byte[] key,
byte[] iv) |
void |
update(byte[] input,
int inputOffset,
int inputLen)
Performs in-place encryption or decryption on the given data.
|
public BaseCipher(int ivsize,
int bsize,
java.lang.String algorithm,
java.lang.String transformation)
public int getBlockSize()
getBlockSize in interface Cipherpublic int getIVSize()
public void init(Cipher.Mode mode, byte[] key, byte[] iv)
Cipherprotected abstract void initCipher(javax.crypto.Cipher cipher,
Cipher.Mode mode,
byte[] key,
byte[] iv)
throws java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException
java.security.InvalidKeyExceptionjava.security.InvalidAlgorithmParameterExceptionprotected javax.crypto.spec.SecretKeySpec getKeySpec(byte[] key)
protected int getMode(Cipher.Mode mode)
public void update(byte[] input,
int inputOffset,
int inputLen)
Cipher