railo.runtime.crypt
Class Cryptor
java.lang.Object
railo.runtime.crypt.Cryptor
public class Cryptor
- extends Object
This program generates a AES key, retrieves its raw bytes, and
then reinstantiates a AES key from the key bytes.
The reinstantiated key is used to initialize a AES cipher for
encryption and decryption.
Cryptor
public Cryptor()
encrypt
public static byte[] encrypt(String type,
String key,
String message)
throws NoSuchAlgorithmException,
NoSuchPaddingException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
- Throws:
NoSuchAlgorithmException
NoSuchPaddingException
InvalidKeyException
IllegalBlockSizeException
BadPaddingException
encrypt
public static byte[] encrypt(String type,
String key,
byte[] message)
throws NoSuchAlgorithmException,
NoSuchPaddingException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
- Throws:
NoSuchAlgorithmException
NoSuchPaddingException
InvalidKeyException
IllegalBlockSizeException
BadPaddingException
decrypt
public static byte[] decrypt(String type,
String key,
String message)
throws NoSuchAlgorithmException,
NoSuchPaddingException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
- Throws:
NoSuchAlgorithmException
NoSuchPaddingException
InvalidKeyException
IllegalBlockSizeException
BadPaddingException
decrypt
public static byte[] decrypt(String type,
String key,
byte[] message)
throws NoSuchAlgorithmException,
NoSuchPaddingException,
InvalidKeyException,
IllegalBlockSizeException,
BadPaddingException
- Throws:
NoSuchAlgorithmException
NoSuchPaddingException
InvalidKeyException
IllegalBlockSizeException
BadPaddingException
Copyright © 2012 Railo