org.lexevs.system.utility
Class CryptoUtility

java.lang.Object
  extended by org.lexevs.system.utility.CryptoUtility

public final class CryptoUtility
extends java.lang.Object

The Class CryptoUtility.

Author:
Kevin Peterson

Field Summary
protected static char[] key
          Internal Key.
 
Method Summary
static java.lang.String decrypt(java.lang.String ciphertext)
          Decrypts cipher text using the shared passphrase.
static java.lang.String encrypt(java.lang.String cleartext)
          Encrypts data.
protected static javax.crypto.SecretKey getKey()
          Gets the key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

protected static char[] key
Internal Key.

Method Detail

encrypt

public static java.lang.String encrypt(java.lang.String cleartext)
Encrypts data.

Parameters:
cleartext - the cleartext
Returns:
the string
Throws:
java.security.GeneralSecurityException - on an encryption error

decrypt

public static java.lang.String decrypt(java.lang.String ciphertext)
Decrypts cipher text using the shared passphrase.

Parameters:
ciphertext - the ciphertext
Returns:
The decrypted text.

getKey

protected static javax.crypto.SecretKey getKey()
                                        throws java.security.GeneralSecurityException
Gets the key.

Returns:
the key
Throws:
java.security.GeneralSecurityException - the general security exception

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.