Modifier and Type | Field and Description |
---|---|
static String |
ERROR_KEY_DEC_ERROR |
static String |
ERROR_KEY_ENC_ERROR |
static String |
ERROR_KEY_IV_NOT_SET |
static String |
ERROR_KEY_KEY_NOT_SET |
static String |
LOG_KEY_DEC_SUCCESSFUL |
static String |
LOG_KEY_DEF_CIPHER_CREATED |
static String |
LOG_KEY_ENC_SUCCESSFUL |
static String |
LOG_KEY_IV_GEN |
static String |
LOG_KEY_KEY_GEN |
Constructor and Description |
---|
SimpleCipher() |
Modifier and Type | Method and Description |
---|---|
protected Cipher |
createDefaultCipher() |
byte[] |
decrypt(byte[] encrypted) |
String |
decryptBase64(String encrypted) |
byte[] |
encrypt(byte[] clear) |
String |
encryptBase64(String clear) |
Cipher |
getCipher() |
byte[] |
getIv() |
Key |
getKey() |
void |
setCipher(Cipher cipher) |
void |
setIv(byte[] iv) |
void |
setKey(Key key) |
public static final String LOG_KEY_ENC_SUCCESSFUL
public static final String LOG_KEY_DEC_SUCCESSFUL
public static final String LOG_KEY_KEY_GEN
public static final String LOG_KEY_IV_GEN
public static final String LOG_KEY_DEF_CIPHER_CREATED
public static final String ERROR_KEY_KEY_NOT_SET
public static final String ERROR_KEY_IV_NOT_SET
public static final String ERROR_KEY_ENC_ERROR
public static final String ERROR_KEY_DEC_ERROR
public Key getKey()
public void setKey(Key key)
public byte[] getIv()
public void setIv(byte[] iv)
public Cipher getCipher()
public void setCipher(Cipher cipher)
public String encryptBase64(String clear) throws CryptoException
CryptoException
public byte[] encrypt(byte[] clear) throws CryptoException
CryptoException
public String decryptBase64(String encrypted) throws CryptoException
CryptoException
public byte[] decrypt(byte[] encrypted) throws CryptoException
CryptoException
protected Cipher createDefaultCipher()
Copyright © 2023 CrafterCMS. All rights reserved.