Project Wonder 5.0

er.extensions.crypting
Class ERXDESCrypter

java.lang.Object
  extended by er.extensions.crypting.ERXDESCrypter
All Implemented Interfaces:
ERXCrypterInterface

public class ERXDESCrypter
extends java.lang.Object
implements ERXCrypterInterface

ERXDESCrypto is a DES implementation of the crypter interface.

Author:
mschrag

Field Summary
static org.apache.log4j.Logger log
           
 
Constructor Summary
ERXDESCrypter()
           
ERXDESCrypter(java.lang.String secretKeyPathFramework, java.lang.String secretKeyPath)
           
 
Method Summary
 java.lang.String decrypt(java.lang.String cryptedText)
          Base64 decodes and then DES decrypts the passed in string using the secret key returned by secretKey.
 java.lang.String decrypt(java.lang.String cryptedText, java.security.Key secretKey)
          Base64 decodes and then DES decrypts the passed in string using the passed in secret key.
protected  java.security.Key defaultSecretKey()
          Returns the DES java.security.Key found in the key file.
 java.lang.String encrypt(java.lang.String clearText)
          DES Encrypts and then base64 encodes the passed in String using the secret key returned by secretKey.
 java.lang.String encrypt(java.lang.String clearText, java.security.Key secretKey)
          DES Encrypts and then base64 encodes the passed in String using the passed in secret key.
 void setSecretKeyPath(java.lang.String secretKeyPath)
           
 void setSecretKeyPathFramework(java.lang.String secretKeyPathFramework)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final org.apache.log4j.Logger log
Constructor Detail

ERXDESCrypter

public ERXDESCrypter()

ERXDESCrypter

public ERXDESCrypter(java.lang.String secretKeyPathFramework,
                     java.lang.String secretKeyPath)
Method Detail

setSecretKeyPathFramework

public void setSecretKeyPathFramework(java.lang.String secretKeyPathFramework)

setSecretKeyPath

public void setSecretKeyPath(java.lang.String secretKeyPath)

defaultSecretKey

protected java.security.Key defaultSecretKey()
Returns the DES java.security.Key found in the key file. The Key is cached once it's found so further hits to the disk are unnecessary. If the key file cannot be found, the method creates a key and writes out a key file.


decrypt

public java.lang.String decrypt(java.lang.String cryptedText)
Base64 decodes and then DES decrypts the passed in string using the secret key returned by secretKey.

Specified by:
decrypt in interface ERXCrypterInterface
Parameters:
cryptedText - the string to decrypt
Returns:
the decrypted string

decrypt

public java.lang.String decrypt(java.lang.String cryptedText,
                                java.security.Key secretKey)
Base64 decodes and then DES decrypts the passed in string using the passed in secret key.


encrypt

public java.lang.String encrypt(java.lang.String clearText)
DES Encrypts and then base64 encodes the passed in String using the secret key returned by secretKey. The base64 encoding is performed to ensure that the encrypted string can be stored in places that don't support extended character sets.

Specified by:
encrypt in interface ERXCrypterInterface
Parameters:
clearText - the text to encrypt
Returns:
an encrypted version of the text

encrypt

public java.lang.String encrypt(java.lang.String clearText,
                                java.security.Key secretKey)
DES Encrypts and then base64 encodes the passed in String using the passed in secret key. The base64 encoding is performed to ensure that the encrypted string can be stored in places that don't support extended character sets.


Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.