Class GenerateKey

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.GenerateKey
All Implemented Interfaces:
java.lang.Cloneable

public class GenerateKey
extends Task
Generates a key in a keystore.
Since:
Ant 1.2
  • Field Details

  • Constructor Details

  • 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.
    • setDname

      public void setDname​(java.lang.String dname)
      The distinguished name for entity.
      Parameters:
      dname - distinguished name
    • setSaname

      public void setSaname​(java.lang.String saname)
      The subject alternative name for entity.
      Parameters:
      saname - subject alternative name
      Since:
      Ant 1.9.14
    • setAlias

      public void setAlias​(java.lang.String alias)
      The alias to add under.
      Parameters:
      alias - alias to add under
    • setKeystore

      public void setKeystore​(java.lang.String keystore)
      Keystore location.
      Parameters:
      keystore - location
    • setStorepass

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

      public void setStoretype​(java.lang.String storetype)
      Keystore type.
      Parameters:
      storetype - type
    • setKeypass

      public void setKeypass​(java.lang.String keypass)
      Password for private key (if different).
      Parameters:
      keypass - password
    • setSigalg

      public void setSigalg​(java.lang.String sigalg)
      The algorithm to use in signing.
      Parameters:
      sigalg - algorithm
    • setKeyalg

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

      public void setKeysize​(java.lang.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.
    • setValidity

      public void setValidity​(java.lang.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
    • execute

      public void execute() throws BuildException
      Execute the task.
      Overrides:
      execute in class Task
      Throws:
      BuildException - on error