com.ibm.cryptobeans
Class MessageUnwrapper

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

public class MessageUnwrapper
extends CryptoTransformation

This class (together with MessageWrapper) extends the functionality of PBEncryptor. These classes provide both convenient password-based encryption scheme and data integrity check. MessageWrapper reads the source data (and the password) and wraps it into the output message of a special format. The main blocks of the output message are:
- the hash value of the secret key;
- the secret key ciphered with the password-based encryption;
- the source message ciphered with the secret key;
- the hash value of the source message.
MessageUnwrapper tries to unwrap the file, which name is defined in the inputSourceFileName property. It checks the password entered by the user and fires the incorrectPassword event if the password is wrong. It also provides data integrity check by means of recalculating the message hash function value. If this hash value differs from the value in the wrapped file thecontentsCorrupted event is fired.

See Also:
Serialized Form

Constructor Summary
MessageUnwrapper()
          The default constructor for the MessageUnwrapper class.
 
Method Summary
 void addContentsCorruptedListener(ContentsCorruptedListener newListener)
          This method adds a new contentsCorrupted event listener to the listeners list.
 void addIncorrectPasswordListener(IncorrectPasswordListener newListener)
          This method adds a new incorrectPassword event listener to the listeners list.
 java.lang.String getAboutThisBean()
          Returns a special formatted string intended for use by the editor of this property.
 java.lang.String getCipherAlgorithmType()
          Gets the cipherAlgorithmType property (java.lang.String) value.
 java.lang.String getCipherProviderName()
          Gets the cipherProviderName property (java.lang.String) value.
 java.lang.String getDescription()
          Gets the description property (java.lang.String) value.
 java.lang.String getHashAlgorithmType()
          Gets the hashAlgorithmType property (java.lang.String) value.
 java.lang.String getHashProviderName()
          Gets the hashProviderName property (java.lang.String) value.
 char[] getInputPassword()
          Gets the inputPassword property (char[]) value.
 java.lang.String getPbCipherAlgorithmType()
          Gets the pbCipherAlgorithmType property (java.lang.String) value.
 java.lang.String getPbCipherProviderName()
          Gets the pbCipherProviderName property (java.lang.String) value.
 void removeContentsCorruptedListener(ContentsCorruptedListener newListener)
          Removes ContentsCorruptedListener from the listeners list.
 void removeIncorrectPasswordListener(IncorrectPasswordListener newListener)
          Removes IncorrectPasswordListener from the listeners list.
 void setAboutThisBean(java.lang.String aboutThisBean)
          Sets the aboutThisBean property (java.lang.String) value.
 void setCipherAlgorithmType(java.lang.String cipherAlgorithmType)
          Sets the cipherAlgorithmType property (java.lang.String) value.
 void setCipherProviderName(java.lang.String cipherProviderName)
          Sets the cipherProviderName property (java.lang.String) value.
 void setHashAlgorithmType(java.lang.String hashAlgorithmType)
          Sets the hashAlgorithmType property (java.lang.String) value.
 void setHashProviderName(java.lang.String hashProviderName)
          Sets the hashProviderName property (java.lang.String) value.
 void setInputPassword(char[] inputPassword)
          Sets the inputPassword property (char[]) value.
 void setPbCipherAlgorithmType(java.lang.String pbCipherAlgorithmType)
          Sets the pbCipherAlgorithmType property (java.lang.String) value.
 void setPbCipherProviderName(java.lang.String pbCipherProviderName)
          Sets the pbCipherProviderName 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

MessageUnwrapper

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

addContentsCorruptedListener

public void addContentsCorruptedListener(ContentsCorruptedListener newListener)
This method adds a new contentsCorrupted event listener to the listeners list.
Parameters:
newListener - com.ibm.cryptobeans.events.ContentsCorruptedListener.

addIncorrectPasswordListener

public void addIncorrectPasswordListener(IncorrectPasswordListener newListener)
This method adds a new incorrectPassword event listener to the listeners list.
Parameters:
newListener - com.ibm.cryptobeans.events.IncorrectPasswordListener.

getCipherAlgorithmType

public java.lang.String getCipherAlgorithmType()
Gets the cipherAlgorithmType property (java.lang.String) value.
Returns:
The cipherAlgorithmType property value.
See Also:
setCipherAlgorithmType(java.lang.String)

getCipherProviderName

public java.lang.String getCipherProviderName()
Gets the cipherProviderName property (java.lang.String) value.
Returns:
The cipherProviderName property value.
See Also:
setCipherProviderName(java.lang.String)

getDescription

public java.lang.String getDescription()
Gets the description property (java.lang.String) value.
Returns:
The description property value.
See Also:
#setDescription

getHashAlgorithmType

public java.lang.String getHashAlgorithmType()
Gets the hashAlgorithmType property (java.lang.String) value.
Returns:
The hashAlgorithmType property value.
See Also:
setHashAlgorithmType(java.lang.String)

getHashProviderName

public java.lang.String getHashProviderName()
Gets the hashProviderName property (java.lang.String) value.
Returns:
The hashProviderName property value.
See Also:
setHashProviderName(java.lang.String)

getInputPassword

public char[] getInputPassword()
Gets the inputPassword property (char[]) value.
Returns:
The inputPassword property value.
See Also:
setInputPassword(char[])

removeContentsCorruptedListener

public void removeContentsCorruptedListener(ContentsCorruptedListener newListener)
Removes ContentsCorruptedListener from the listeners list.
Parameters:
newListener - The ContentsCorruptedListener to be removed.
See Also:
ContentsCorruptedListener

removeIncorrectPasswordListener

public void removeIncorrectPasswordListener(IncorrectPasswordListener newListener)
Removes IncorrectPasswordListener from the listeners list.
Parameters:
newListener - The IncorrectPasswordListener to be removed.
See Also:
ContentsCorruptedListener

setCipherAlgorithmType

public void setCipherAlgorithmType(java.lang.String cipherAlgorithmType)
Sets the cipherAlgorithmType property (java.lang.String) value.
Parameters:
cipherAlgorithmType - The new value for the property.
See Also:
getCipherAlgorithmType()

setCipherProviderName

public void setCipherProviderName(java.lang.String cipherProviderName)
Sets the cipherProviderName property (java.lang.String) value.
Parameters:
cipherProviderName - The new value for the property.
See Also:
getCipherProviderName()

setHashAlgorithmType

public void setHashAlgorithmType(java.lang.String hashAlgorithmType)
Sets the hashAlgorithmType property (java.lang.String) value.
Parameters:
hashAlgorithmType - The new value for the property.
See Also:
getHashAlgorithmType()

setHashProviderName

public void setHashProviderName(java.lang.String hashProviderName)
Sets the hashProviderName property (java.lang.String) value.
Parameters:
hashProviderName - The new value for the property.
See Also:
getHashProviderName()

setInputPassword

public void setInputPassword(char[] inputPassword)
Sets the inputPassword property (char[]) value.
Parameters:
inputPassword - The new value for the property.
See Also:
getInputPassword()

getPbCipherAlgorithmType

public java.lang.String getPbCipherAlgorithmType()
Gets the pbCipherAlgorithmType property (java.lang.String) value.
Returns:
The pbCipherAlgorithmType property value.
See Also:
setPbCipherAlgorithmType(java.lang.String)

getPbCipherProviderName

public java.lang.String getPbCipherProviderName()
Gets the pbCipherProviderName property (java.lang.String) value.
Returns:
The pbCipherProviderName property value.
See Also:
setPbCipherProviderName(java.lang.String)

setPbCipherAlgorithmType

public void setPbCipherAlgorithmType(java.lang.String pbCipherAlgorithmType)
Sets the pbCipherAlgorithmType property (java.lang.String) value.
Parameters:
pbCipherAlgorithmType - The new value for the property.
See Also:
getPbCipherAlgorithmType()

setPbCipherProviderName

public void setPbCipherProviderName(java.lang.String pbCipherProviderName)
Sets the pbCipherProviderName property (java.lang.String) value.
Parameters:
pbCipherProviderName - The new value for the property.
See Also:
getPbCipherProviderName()

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)
Sets the aboutThisBean property (java.lang.String) value.
Parameters:
aboutThisBean - The new value for the property.
See Also:
getAboutThisBean()