goldengate.common.crypto
Class DynamicKeyObject

java.lang.Object
  extended by goldengate.common.crypto.KeyObject
      extended by goldengate.common.crypto.DynamicKeyObject

public class DynamicKeyObject
extends KeyObject

This class handles methods to encrypt and unencrypt messages with any available algorithms in the JVM.
AES is the best compromise in term of security and efficiency.
Usage:

Author:
frederic bregier

Nested Class Summary
static class DynamicKeyObject.INSTANCES
          Minimal key size
static class DynamicKeyObject.INSTANCESMAX
          Recommended key size when normal JVM installed (no extension on encrypt support)
 
Field Summary
 String ALGO
          Short name for the algorithm
 String EXTENSION
          The extension for the file to use when saving the key (note that an extra file as extension.inf will be also saved for the extra information)
 String INSTANCE
          Could be the shortname again (default implementation in JVM) or the full name as DES/ECB/PKCS5Padding
 int KEY_SIZE
          This value could be between 32 and 128 due to license limitation.
 
Constructor Summary
DynamicKeyObject(DynamicKeyObject.INSTANCESMAX instance, String eXTENSION)
           
DynamicKeyObject(DynamicKeyObject.INSTANCES instance, String eXTENSION)
           
DynamicKeyObject(int kEYSIZE, String aLGO, String iNSTANCE, String eXTENSION)
           
 
Method Summary
 String getAlgorithm()
           
 String getInstance()
           
 int getKeySize()
           
static void main(String[] args)
          This method allows to test the correctness of this class
 
Methods inherited from class goldengate.common.crypto.KeyObject
crypt, crypt, cryptToHex, cryptToHex, decodeHex, decrypt, decryptHexFile, decryptHexInBytes, decryptHexInBytes, decryptHexInString, decryptInString, encodeHex, generateKey, getSecretKey, getSecretKeyInBytes, keyReady, saveSecretKey, setSecretKey, setSecretKey, setSecretKey, toCrypt, toDecrypt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KEY_SIZE

public final int KEY_SIZE
This value could be between 32 and 128 due to license limitation.


ALGO

public final String ALGO
Short name for the algorithm


INSTANCE

public final String INSTANCE
Could be the shortname again (default implementation in JVM) or the full name as DES/ECB/PKCS5Padding


EXTENSION

public final String EXTENSION
The extension for the file to use when saving the key (note that an extra file as extension.inf will be also saved for the extra information)

Constructor Detail

DynamicKeyObject

public DynamicKeyObject(int kEYSIZE,
                        String aLGO,
                        String iNSTANCE,
                        String eXTENSION)
Parameters:
kEYSIZE - example DES: 56
aLGO - example DES: DES
iNSTANCE - example DES: DES/ECB/PKCS5Padding
eXTENSION - example DES: des

DynamicKeyObject

public DynamicKeyObject(DynamicKeyObject.INSTANCES instance,
                        String eXTENSION)
Parameters:
instance - the minimal default instance
eXTENSION - to use for files

DynamicKeyObject

public DynamicKeyObject(DynamicKeyObject.INSTANCESMAX instance,
                        String eXTENSION)
Parameters:
instance - the maximal default instance
eXTENSION - to use for files
Method Detail

getAlgorithm

public String getAlgorithm()
Specified by:
getAlgorithm in class KeyObject
Returns:
the algorithm used (Java name)

getInstance

public String getInstance()
Specified by:
getInstance in class KeyObject
Returns:
the instance used (Java name)

getKeySize

public int getKeySize()
Specified by:
getKeySize in class KeyObject
Returns:
the size for the algorithm key

main

public static void main(String[] args)
                 throws Exception
This method allows to test the correctness of this class

Parameters:
args -
Throws:
Exception


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.