net.sourceforge.rssowl.util
Class CryptoManager

java.lang.Object
  extended bynet.sourceforge.rssowl.util.CryptoManager

public class CryptoManager
extends Object

This class handles sensitive user data.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
private  net.sourceforge.blowfishj.BlowfishEasy blowFish
           
private  Hashtable crypta
           
private static CryptoManager instance
          An instance of the CryptoManager
static String PROXY_DOMAIN_KEY
          Unique key for the proxy domain (NTLM only)
static String PROXY_PASSWORD_KEY
          Unique key for the proxy password
static String PROXY_USER_KEY
          Unique key for the proxy username
 
Constructor Summary
private CryptoManager()
          Called from the static factory Method
 
Method Summary
 void addItem(String key, String value)
          Add an item to the crypta.
private  void decryptData()
          Decrypt the crypta.
private  void encryptData()
          Encrypt the crypta.
static CryptoManager getInstance()
          Instantiate a new CryptoManager when this method is called the first time and return it.
 String getItem(String key)
          Get an item from the crypta.
 boolean hasItem(String key)
          Check if the crypta contains an item for the given key
private  void loadData()
          Load the crypta from a file.
 String loadProxyDomain()
          Load the proxy Domain from the crypta.
 String loadProxyPassword()
          Load the proxy password from the crypta.
 String loadProxyUser()
          Load the proxy username from the crypta.
 void removeItem(String key)
          Remove an item from the crapty.
 void saveData()
          Save the crypta to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROXY_DOMAIN_KEY

public static final String PROXY_DOMAIN_KEY
Unique key for the proxy domain (NTLM only)

See Also:
Constant Field Values

PROXY_PASSWORD_KEY

public static final String PROXY_PASSWORD_KEY
Unique key for the proxy password

See Also:
Constant Field Values

PROXY_USER_KEY

public static final String PROXY_USER_KEY
Unique key for the proxy username

See Also:
Constant Field Values

instance

private static CryptoManager instance
An instance of the CryptoManager


blowFish

private net.sourceforge.blowfishj.BlowfishEasy blowFish

crypta

private Hashtable crypta
Constructor Detail

CryptoManager

private CryptoManager()
Called from the static factory Method

Method Detail

getInstance

public static CryptoManager getInstance()
Instantiate a new CryptoManager when this method is called the first time and return it.

Returns:
CryptoManager An instance of the CryptoManager

addItem

public void addItem(String key,
                    String value)
Add an item to the crypta.

Parameters:
key - Unique key of the item
value - Value of the item

getItem

public String getItem(String key)
Get an item from the crypta.

Parameters:
key - Unique key of the item
Returns:
String The value of the item

hasItem

public boolean hasItem(String key)
Check if the crypta contains an item for the given key

Parameters:
key - Unique key of the item
Returns:
boolean TRUE if item is in crypta

loadProxyDomain

public String loadProxyDomain()
Load the proxy Domain from the crypta.

Returns:
String The proxy Domain or an empty String if not stored in the crypta

loadProxyPassword

public String loadProxyPassword()
Load the proxy password from the crypta.

Returns:
String The proxy password or an empty String if not stored in the crypta

loadProxyUser

public String loadProxyUser()
Load the proxy username from the crypta.

Returns:
String The proxy username or an empty String if not stored in the crypta

removeItem

public void removeItem(String key)
Remove an item from the crapty.

Parameters:
key - Unique key of the item.

saveData

public void saveData()
Save the crypta to a file.


decryptData

private void decryptData()
Decrypt the crypta.


encryptData

private void encryptData()
Encrypt the crypta.


loadData

private void loadData()
Load the crypta from a file.



RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo