com.ibm.cryptobeans
Class Encryptor

java.lang.Object
  |
  +--com.ibm.processingbean.ProcessingBean
        |
        +--com.ibm.cryptobeans.CryptoTransformation
              |
              +--com.ibm.cryptobeans.Encryptor

public class Encryptor
extends CryptoTransformation

This class should be used to encrypt and decrypt file contents by means of a symmetric cipher (DES, DESede and any other symmetric cipher, which is supported by the user's cryptographic service provider and is selected in the bean's properties).
Since the class uses a symmetric cipher, only the owners of the Secret Key may decrypt the data transformed by this class. In the ENCRYPT mode this class performs encryption of the source file. By default the secret key is generated randomly and saved in the "usedKey.key" file in the current directory. It is possible to explicitly specify the custom key file name, which contains secret key bytes, which will be used for encryption. Note, that in the DECRYPT mode you have to explicitly specify the custom key file,otherwise the cryptoTransformationError event is fired.

See Also:
Serialized Form

Constructor Summary
Encryptor()
          The default constructor for the Encryptor class.
 
Method Summary
 java.lang.String getAboutThisBean()
          Returns a special formatted string intended for use by the editor of this property.
 int getCipherKeySize()
          Gets the cipherKeySize property (int) value.
 java.lang.String getCustomKeyFileName()
          Gets the customKeyFileName property (java.lang.String) value.
 java.lang.String getInputMode()
          Gets the inputMode property (java.lang.String) value.
 java.lang.String getUsedKeyFileName()
          Gets the usedKeyFileName property (java.lang.String) value.
 void setAboutThisBean(java.lang.String aboutThisBean)
          Setter method for the aboutThisBean property to be available in the properties list.
 void setCipherKeySize(int cipherKeySize)
          Sets the cipherKeySize property (int) value.
 void setCustomKeyFileName(java.lang.String customKeyFileName)
          Sets the customKeyFileName property (java.lang.String) value.
 void setInputMode(java.lang.String inputMode)
          Sets the inputMode property (java.lang.String) value.
 void setUsedKeyFileName(java.lang.String usedKeyFileName)
          Sets the usedKeyFileName property (java.lang.String) value.
 
Methods inherited from class com.ibm.cryptobeans.CryptoTransformation
addCryptoTransformationErrorListener, addIOErrorListener, getAlgorithmType, getInputSourceFileName, getInputTransformedFileName, getProviderName, getTransformedPercent, removeCryptoTransformationErrorListener, removeIOErrorListener, setAlgorithmType, setInputSourceFileName, setInputTransformedFileName, setProviderName, triggerAction
 
Methods inherited from class com.ibm.processingbean.ProcessingBean
addActionErrorListener, addFetchArgumentsListener, addPropertyChangeListener, addTriggerNextActionListener, removeActionErrorListener, removeFetchArgumentsListener, removePropertyChangeListener, removeTriggerNextActionListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encryptor

public Encryptor()
The default constructor for the Encryptor class.
Method Detail

getCipherKeySize

public int getCipherKeySize()
Gets the cipherKeySize property (int) value.
Returns:
The cipherKeySize property value.
See Also:
setCipherKeySize(int)

getCustomKeyFileName

public java.lang.String getCustomKeyFileName()
Gets the customKeyFileName property (java.lang.String) value.
Returns:
The customKeyFileName property value.
See Also:
setCustomKeyFileName(java.lang.String)

getInputMode

public java.lang.String getInputMode()
Gets the inputMode property (java.lang.String) value.
Returns:
The inputMode property value.
See Also:
setInputMode(java.lang.String)

getUsedKeyFileName

public java.lang.String getUsedKeyFileName()
Gets the usedKeyFileName property (java.lang.String) value.
Returns:
The usedKeyFileName property value.
See Also:
setUsedKeyFileName(java.lang.String)

setCipherKeySize

public void setCipherKeySize(int cipherKeySize)
Sets the cipherKeySize property (int) value.
Parameters:
cipherKeySize - The new value for the property.
See Also:
getCipherKeySize()

setCustomKeyFileName

public void setCustomKeyFileName(java.lang.String customKeyFileName)
Sets the customKeyFileName property (java.lang.String) value.
Parameters:
customKeyFileName - The new value for the property.
See Also:
getCustomKeyFileName()

setInputMode

public void setInputMode(java.lang.String inputMode)
                  throws java.lang.IllegalArgumentException
Sets the inputMode property (java.lang.String) value.
Parameters:
inputMode - The new value for the property.
See Also:
getInputMode()

setUsedKeyFileName

public void setUsedKeyFileName(java.lang.String usedKeyFileName)
Sets the usedKeyFileName property (java.lang.String) value.
Parameters:
usedKeyFileName - The new value for the property.
See Also:
getUsedKeyFileName()

getAboutThisBean

public java.lang.String getAboutThisBean()
Returns a special formatted string intended for use by the editor of this property.
Returns:
the special formatted string for use by the editor of this property

setAboutThisBean

public void setAboutThisBean(java.lang.String aboutThisBean)
Setter method for the aboutThisBean property to be available in the properties list. This method should not be used to set the aboutThisBean property value.
Parameters:
aboutThisBean - the special formatted string