org.apache.geronimo.util
Class SimpleEncryption

java.lang.Object
  extended by org.apache.geronimo.util.SimpleEncryption

public class SimpleEncryption
extends Object

This class protects some value BY ENCRYPTING WITH A KNOWN KEY. That is to say, it's only safe against anyone who can't read the source code. So the main idea is to protect against casual observers. If someone has a better idea for how to implement encryption with a non-obvious key that the user isn't likely to change during the normal course of working with the server, I'd be happy to hear it. (But I assume the SSL keystore is likely to be changed, which would result in losing all the "encrypted" data.


Constructor Summary
SimpleEncryption()
           
 
Method Summary
static Object decrypt(String source)
          Given a String which is the Base64-encoded encrypted data, retrieve the original Object.
static String encrypt(Serializable source)
          Gets a String which contains the Base64-encoded form of the source, encrypted with the known key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleEncryption

public SimpleEncryption()
Method Detail

encrypt

public static String encrypt(Serializable source)
Gets a String which contains the Base64-encoded form of the source, encrypted with the known key.


decrypt

public static Object decrypt(String source)
Given a String which is the Base64-encoded encrypted data, retrieve the original Object.



Copyright © 2006 Apache Software Foundation. All Rights Reserved.