public class StateEncryptation extends Object
| Constructor and Description |
|---|
StateEncryptation(byte[] key) |
StateEncryptation(String key) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
decrypt(byte[] cipherText)
Decrypts the given byte array
|
String |
decryptBase64(String cipherText)
Decrypts the given base64 string.
|
byte[] |
encrypt(byte[] plainText)
Encrypts the given plain text
|
String |
encryptBase64(String plainText)
Encrypts the given plain text to a base64 string.
|
public StateEncryptation(byte[] key)
public StateEncryptation(String key)
public byte[] encrypt(byte[] plainText)
throws NoSuchAlgorithmException,
NoSuchPaddingException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
plainText - The plain text to encryptNoSuchAlgorithmException - Throw in the encryptNoSuchPaddingException - Throw in the encryptInvalidKeyException - Throw in the encryptIllegalBlockSizeException - Throw in the encryptBadPaddingException - Throw in the encryptpublic String encryptBase64(String plainText) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException
plainText - The plain text to encryptNoSuchAlgorithmException - Throw in the encryptNoSuchPaddingException - Throw in the encryptInvalidKeyException - Throw in the encryptIllegalBlockSizeException - Throw in the encryptBadPaddingException - Throw in the encryptpublic byte[] decrypt(byte[] cipherText)
throws NoSuchAlgorithmException,
NoSuchPaddingException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
cipherText - The data to decryptNoSuchAlgorithmException - Throw in the decrypt.NoSuchPaddingException - Throw in the decrypt.InvalidKeyException - Throw in the decrypt.IllegalBlockSizeException - Throw in the decrypt.BadPaddingException - Throw in the decrypt.public String decryptBase64(String cipherText) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException
cipherText - The data to decryptNoSuchAlgorithmException - Throw in the decrypt.NoSuchPaddingException - Throw in the decrypt.InvalidKeyException - Throw in the decrypt.IllegalBlockSizeException - Throw in the decrypt.BadPaddingException - Throw in the decrypt.Copyright © 2015–2018 Bridje Framework. All rights reserved.