railo.runtime.crypt
Class Cryptor

java.lang.Object
  extended by 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.


Constructor Summary
Cryptor()
           
 
Method Summary
static byte[] decrypt(String type, String key, byte[] message)
           
static byte[] decrypt(String type, String key, String message)
           
static byte[] encrypt(String type, String key, byte[] message)
           
static byte[] encrypt(String type, String key, String message)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cryptor

public Cryptor()
Method Detail

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