public static class CryptoUtils.CipherParams
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private CryptoUtils.CipherEngine |
engine
Cipher algorithm name
|
private int |
ivSize
Cipher IV size
|
private int |
keySize
Cipher key size
|
private CryptoUtils.CipherMode |
mode
Cipher algorithm mode
|
| Constructor and Description |
|---|
CipherParams(java.lang.String spec)
Constructor which creates CipherParams instance for a 4GL style spec string
|
| Modifier and Type | Method and Description |
|---|---|
javax.crypto.Cipher |
cipher()
Get a new Cipher instance for the specified parameters
|
CryptoUtils.CipherEngine |
getEngine()
Get cipher code
|
int |
getIvSize()
Get IV size in bytes
|
int |
getKeySize()
Get key size in bytes
|
CryptoUtils.CipherMode |
getMode()
Get cipher mode
|
byte[] |
newIV()
Get empty byte array of the required IV size
|
byte[] |
newKey()
Get empty byte array of the required key size
|
byte[] |
process(byte[] data,
int mode,
byte[] key,
byte[] iv)
Encrypt/Decript byte array
|
java.lang.String |
toString()
return String representation of the CipherParams instance
|
private final CryptoUtils.CipherEngine engine
private final CryptoUtils.CipherMode mode
private final int keySize
private final int ivSize
public CipherParams(java.lang.String spec)
spec - A 4GL style spec stringpublic CryptoUtils.CipherEngine getEngine()
public CryptoUtils.CipherMode getMode()
public int getKeySize()
public int getIvSize()
public byte[] newIV()
public byte[] newKey()
public byte[] process(byte[] data,
int mode,
byte[] key,
byte[] iv)
throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException,
javax.crypto.NoSuchPaddingException,
java.security.InvalidKeyException,
java.security.InvalidAlgorithmParameterException,
javax.crypto.IllegalBlockSizeException,
javax.crypto.BadPaddingException
data - source datamode - operation modekey - encryption/decryption keyiv - encryption/decryption IVjava.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionjavax.crypto.NoSuchPaddingExceptionjava.security.InvalidKeyExceptionjava.security.InvalidAlgorithmParameterExceptionjavax.crypto.IllegalBlockSizeExceptionjavax.crypto.BadPaddingExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic javax.crypto.Cipher cipher()
throws java.security.NoSuchAlgorithmException,
java.security.NoSuchProviderException,
javax.crypto.NoSuchPaddingException
java.security.NoSuchAlgorithmExceptionjava.security.NoSuchProviderExceptionjavax.crypto.NoSuchPaddingException