edu.vt.middleware.crypt.tasks
Class AbstractCryptTask

java.lang.Object
  extended by org.apache.tools.ant.ProjectComponent
      extended by org.apache.tools.ant.Task
          extended by edu.vt.middleware.crypt.tasks.AbstractCryptTask
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
DecryptPropertyTask, EncryptPropertyTask

public abstract class AbstractCryptTask
extends org.apache.tools.ant.Task

AbstractCryptTask provides common methods for crypt ant tasks.

Version:
$Revision: 2744 $
Author:
Middleware Services

Field Summary
protected  String algorithm
          Algorithm name.
protected  String iv
          Initialization vector for encryption/decryption.
protected  String mode
          Mode used for encryption and decryption.
protected  String padding
          Padding used for encryption and decryption.
protected  File privateKey
          Private key to read.
protected  String propertyName
          Property name to set.
 
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
 
Constructor Summary
AbstractCryptTask()
           
 
Method Summary
protected  SymmetricAlgorithm createAlgorithm()
          Creates a new symmetric algorithm cipher and initializes it using task properties.
abstract  void execute()
          .
 void setAlgorithm(String s)
          This sets the algorithm used for decryption.
 void setIv(String s)
          This sets the initialization vector used for encryption/decryption.
 void setMode(String s)
          This sets the mode used for decryption.
 void setName(String s)
          This sets the name of the property to set with the decrypted value.
 void setPadding(String s)
          This sets the padding used for decryption.
 void setPrivateKey(File f)
          This sets the private key used for decryption.
 
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propertyName

protected String propertyName
Property name to set.


algorithm

protected String algorithm
Algorithm name.


mode

protected String mode
Mode used for encryption and decryption.


padding

protected String padding
Padding used for encryption and decryption.


iv

protected String iv
Initialization vector for encryption/decryption.


privateKey

protected File privateKey
Private key to read.

Constructor Detail

AbstractCryptTask

public AbstractCryptTask()
Method Detail

setName

public void setName(String s)

This sets the name of the property to set with the decrypted value.

Parameters:
s - String

setAlgorithm

public void setAlgorithm(String s)

This sets the algorithm used for decryption.

Parameters:
s - String

setMode

public void setMode(String s)

This sets the mode used for decryption.

Parameters:
s - String

setPadding

public void setPadding(String s)

This sets the padding used for decryption.

Parameters:
s - String

setIv

public void setIv(String s)

This sets the initialization vector used for encryption/decryption.

Parameters:
s - String

setPrivateKey

public void setPrivateKey(File f)

This sets the private key used for decryption.

Parameters:
f - File

execute

public abstract void execute()
.

See @link{org.apache.tools.ant.Task}.

Overrides:
execute in class org.apache.tools.ant.Task

createAlgorithm

protected SymmetricAlgorithm createAlgorithm()
                                      throws CryptException,
                                             IOException
Creates a new symmetric algorithm cipher and initializes it using task properties.

Returns:
New instance ready for use.
Throws:
CryptException - On cryptographic errors.
IOException - On IO errors reading symmetric key.


Copyright © 2003-2013 Virginia Tech. All Rights Reserved.