org.apache.tools.ant.taskdefs

Class GenerateKey


public class GenerateKey
extends Task

Generates a key in a keystore.
Since:
Ant 1.2

Nested Class Summary

static class
GenerateKey.DistinguishedName
static class
GenerateKey.DnameParam

Field Summary

protected String
alias
The alias of signer.
protected String
dname
protected GenerateKey.DistinguishedName
expandedDname
protected String
keyalg
protected String
keypass
protected int
keysize
protected String
keystore
The name of keystore file.
protected String
sigalg
protected String
storepass
protected String
storetype
protected int
validity
protected boolean
verbose

Fields inherited from class org.apache.tools.ant.Task

description, location, target, taskName, taskType, wrapper

Fields inherited from class org.apache.tools.ant.ProjectComponent

project

Method Summary

GenerateKey.DistinguishedName
createDname()
Distinguished name list.
void
execute()
Called by the project to let the task do its work.
void
setAlias(String alias)
The alias to add under.
void
setDname(String dname)
The distinguished name for entity.
void
setKeyalg(String keyalg)
The method to use when generating name-value pair.
void
setKeypass(String keypass)
Password for private key (if different).
void
setKeysize(String keysize)
Indicates the size of key generated.
void
setKeystore(String keystore)
Keystore location.
void
setSigalg(String sigalg)
The algorithm to use in signing.
void
setStorepass(String storepass)
Password for keystore integrity.
void
setStoretype(String storetype)
Keystore type.
void
setValidity(String validity)
Indicates how many days certificate is valid.
void
setVerbose(boolean verbose)
If true, verbose output when signing.

Methods inherited from class org.apache.tools.ant.Task

execute, getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType

Methods inherited from class org.apache.tools.ant.ProjectComponent

getProject, log, log, setProject

Field Details

alias

protected String alias
The alias of signer.

dname

protected String dname

expandedDname

protected GenerateKey.DistinguishedName expandedDname

keyalg

protected String keyalg

keypass

protected String keypass

keysize

protected int keysize

keystore

protected String keystore
The name of keystore file.

sigalg

protected String sigalg

storepass

protected String storepass

storetype

protected String storetype

validity

protected int validity

verbose

protected boolean verbose

Method Details

createDname

public GenerateKey.DistinguishedName createDname()
            throws BuildException
Distinguished name list.
Returns:
Distinguished name container.
Throws:
BuildException - If specified more than once or dname attribute is used.

execute

public void execute()
            throws BuildException
Called by the project to let the task do its work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.
Overrides:
execute in interface Task
Throws:
BuildException - if something goes wrong with the build

setAlias

public void setAlias(String alias)
The alias to add under.
Parameters:
alias - alias to add under

setDname

public void setDname(String dname)
The distinguished name for entity.
Parameters:
dname - distinguished name

setKeyalg

public void setKeyalg(String keyalg)
The method to use when generating name-value pair.
Parameters:
keyalg - algorithm

setKeypass

public void setKeypass(String keypass)
Password for private key (if different).
Parameters:
keypass - password

setKeysize

public void setKeysize(String keysize)
            throws BuildException
Indicates the size of key generated.
Parameters:
keysize - size of key
Throws:
BuildException - If not an Integer
To do:
Could convert this to a plain Integer setter.

setKeystore

public void setKeystore(String keystore)
Keystore location.
Parameters:
keystore - location

setSigalg

public void setSigalg(String sigalg)
The algorithm to use in signing.
Parameters:
sigalg - algorithm

setStorepass

public void setStorepass(String storepass)
Password for keystore integrity. Must be at least 6 characters long.
Parameters:
storepass - password

setStoretype

public void setStoretype(String storetype)
Keystore type.
Parameters:
storetype - type

setValidity

public void setValidity(String validity)
            throws BuildException
Indicates how many days certificate is valid.
Parameters:
validity - days valid
Throws:
BuildException - If not an Integer

setVerbose

public void setVerbose(boolean verbose)
If true, verbose output when signing.
Parameters:
verbose - verbose or not

Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.