org.apache.turbine.services.crypto.provider
Class OldJavaCrypt

java.lang.Object
  extended byorg.apache.turbine.services.crypto.provider.OldJavaCrypt
All Implemented Interfaces:
CryptoAlgorithm

public class OldJavaCrypt
extends java.lang.Object
implements CryptoAlgorithm

This is the Message Digest Implementation of Turbine 2.1. It does not pad the Base64 encryption of the Message Digests correctly but truncates after 20 chars. This leads to interoperability problems if you want to use e.g. database columns between two languages. If you upgrade an application from Turbine 2.1 and have already used the Security Service with encrypted passwords and no way to rebuild your databases, use this provider. It is bug-compatible. DO NOT USE THIS PROVIDER FOR ANY NEW APPLICATION! Nevertheless it can be used as the default crypto algorithm .

Version:
$Id: OldJavaCrypt.java 534527 2007-05-02 16:10:59Z tv $
Author:
Henning P. Schmiedehausen

Field Summary
static java.lang.String DEFAULT_CIPHER
          The default cipher
 
Constructor Summary
OldJavaCrypt()
          C'tor
 
Method Summary
 java.lang.String encrypt(java.lang.String value)
          Encrypt the supplied string with the requested cipher
 void setCipher(java.lang.String cipher)
          Setting the actual cipher requested.
 void setSeed(java.lang.String seed)
          This class never uses a seed, so this is just a dummy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CIPHER

public static final java.lang.String DEFAULT_CIPHER
The default cipher

See Also:
Constant Field Values
Constructor Detail

OldJavaCrypt

public OldJavaCrypt()
C'tor

Method Detail

setCipher

public void setCipher(java.lang.String cipher)
Setting the actual cipher requested. If not called, then the default cipher (SHA) is used. This will never throw an error even if there is no provider for this cipher. The error will be thrown by encrypt() (Fixme?)

Specified by:
setCipher in interface CryptoAlgorithm
Parameters:
cipher - The cipher to use.

setSeed

public void setSeed(java.lang.String seed)
This class never uses a seed, so this is just a dummy.

Specified by:
setSeed in interface CryptoAlgorithm
Parameters:
seed - Seed (ignored)

encrypt

public java.lang.String encrypt(java.lang.String value)
                         throws java.lang.Exception
Encrypt the supplied string with the requested cipher

Specified by:
encrypt in interface CryptoAlgorithm
Parameters:
value - The value to be encrypted
Returns:
The encrypted value
Throws:
java.lang.Exception - An Exception of the underlying implementation.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.