org.apache.james.mailbox.jpa.mail.model.openjpa
Class EncryptDecryptHelper

java.lang.Object
  extended by org.apache.james.mailbox.jpa.mail.model.openjpa.EncryptDecryptHelper

public class EncryptDecryptHelper
extends Object

Helper class for encrypt and de-crypt data


Constructor Summary
EncryptDecryptHelper()
           
 
Method Summary
static byte[] getDecrypted(byte[] array)
          Decrypt the given array and return the de-crypted one
static byte[] getEncrypted(byte[] array)
          Encrypt the given array and return the encrypted one
static void init(String pass)
          Set the password for encrypt / de-crypt.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EncryptDecryptHelper

public EncryptDecryptHelper()
Method Detail

init

public static void init(String pass)
Set the password for encrypt / de-crypt. This MUST be done before the usage of getDecrypted(byte[]) and getEncrypted(byte[]). So to be safe its the best to call this in a constructor

Parameters:
pass -

getEncrypted

public static byte[] getEncrypted(byte[] array)
Encrypt the given array and return the encrypted one

Parameters:
array -
Returns:
enc-array

getDecrypted

public static byte[] getDecrypted(byte[] array)
Decrypt the given array and return the de-crypted one

Parameters:
array -
Returns:
dec-array


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.