com.ca.jcs.crypto.legacy
Class LegacyCryptoService

java.lang.Object
  extended by com.ca.jcs.crypto.legacy.LegacyCryptoService
All Implemented Interfaces:
Activatable, CryptoService

public class LegacyCryptoService
extends Object
implements CryptoService

This makes use of the static obfuscation used by CA Workflow/Self Service etc, which can be found at Crypt.


Field Summary
static int AES_ALG_I
           
static Map<String,Integer> ALG_LOOKUP
           
static Map<String,Integer> ALG_PREF_LOOKUP
           
static String[] ALG_PREFS
           
static String[] ALGS
           
static int CA_ALG_I
           
static int LND_ALG_I
           
static String PROP_FILE
          Name of properties file containing properties configuring support for all crypto modules used by this service.
static int SHA1_B64_ALG_I
           
 
Constructor Summary
LegacyCryptoService()
           
 
Method Summary
 void activate()
          This method is called when the target object has been fully initialised, and is ready to receive requests.
 void deactivate()
          This method is called when the target object is no longer needed and should tidy-up any connections / resources it holds.
 String decrypt(String defaultAlgorithm, String cipherText)
          Decrypt the provided cipherText falling back to the provided defaultAlgorithm if the cipherText doesn't start with a supported prefix in ALG_PREFS.
 byte[] decryptBytes(String algorithm, byte[] cipherText)
          Stubbed out until know it is needed.
 String encrypt(String algorithm, String clearText)
           
 String encrypt(String algorithm, String clearText, boolean addAlgorithmPrefix)
           
 byte[] encryptBytes(String algorithm, byte[] clearText)
          Stubbed out until know it is needed.
 boolean isActivated()
           
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_FILE

public static final String PROP_FILE
Name of properties file containing properties configuring support for all crypto modules used by this service.

See Also:
Constant Field Values

AES_ALG_I

public static final int AES_ALG_I
See Also:
Constant Field Values

CA_ALG_I

public static final int CA_ALG_I
See Also:
Constant Field Values

LND_ALG_I

public static final int LND_ALG_I
See Also:
Constant Field Values

SHA1_B64_ALG_I

public static final int SHA1_B64_ALG_I
See Also:
Constant Field Values

ALGS

public static final String[] ALGS

ALG_PREFS

public static final String[] ALG_PREFS

ALG_LOOKUP

public static final Map<String,Integer> ALG_LOOKUP

ALG_PREF_LOOKUP

public static final Map<String,Integer> ALG_PREF_LOOKUP
Constructor Detail

LegacyCryptoService

public LegacyCryptoService()
Method Detail

isActivated

public boolean isActivated()

encrypt

public String encrypt(String algorithm,
                      String clearText)
Specified by:
encrypt in interface CryptoService

encrypt

public String encrypt(String algorithm,
                      String clearText,
                      boolean addAlgorithmPrefix)

decrypt

public String decrypt(String defaultAlgorithm,
                      String cipherText)
Decrypt the provided cipherText falling back to the provided defaultAlgorithm if the cipherText doesn't start with a supported prefix in ALG_PREFS.

Specified by:
decrypt in interface CryptoService

encryptBytes

public byte[] encryptBytes(String algorithm,
                           byte[] clearText)
Stubbed out until know it is needed.

Specified by:
encryptBytes in interface CryptoService

decryptBytes

public byte[] decryptBytes(String algorithm,
                           byte[] cipherText)
Stubbed out until know it is needed.

Specified by:
decryptBytes in interface CryptoService

activate

public void activate()
              throws NamingException
Description copied from interface: Activatable
This method is called when the target object has been fully initialised, and is ready to receive requests.

Specified by:
activate in interface Activatable
Throws:
NamingException

deactivate

public void deactivate()
                throws NamingException
Description copied from interface: Activatable
This method is called when the target object is no longer needed and should tidy-up any connections / resources it holds.

Specified by:
deactivate in interface Activatable
Throws:
NamingException

main

public static void main(String[] args)


Created 2011-07-14 13:27 EST