|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
edu.internet2.middleware.ant.pki.SelfSignedCertificate
public class SelfSignedCertificate
An ant task that generates a self-signed certificate. This ant task requires three attributes:
| Nested Class Summary | |
|---|---|
static class |
SelfSignedCertificate.KeyType
Key type enumeration. |
| Field Summary |
|---|
| 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 | |
|---|---|
SelfSignedCertificate()
|
|
| Method Summary | |
|---|---|
protected org.bouncycastle.asn1.ASN1Encodable[] |
buildSubjectAltNames()
Builds the subject alt names for the certificate. |
void |
execute()
|
protected X509Certificate |
generateCertificate(KeyPair keypair)
Generates the self-signed certificate. |
protected KeyPair |
generateKeyPair()
Generates the key pair for the certificate. |
void |
setCertificateFile(File file)
Sets the file to which the certificate will be written. |
void |
setDnsSubjectAltNames(String altNames)
Sets the optional DNS subject alt names. |
void |
setHostName(String name)
Sets the hostname that will appear in the certificate's DN. |
void |
setKeysize(int size)
Sets the size of the generated key. |
void |
setKeystoreFile(File file)
Sets the file to which the keystore will be written. |
void |
setKeystorePassword(String password)
Sets the password for the generated keystore. |
void |
setKeyType(SelfSignedCertificate.KeyType type)
Sets the type of key that will be generated. |
void |
setPrivateKeyFile(File file)
Sets the file to which the private key will be written. |
void |
setUriSubjectAltNames(String altNames)
Sets the optional URI subject alt names. |
protected void |
validate()
Validates the provided task input. |
| 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 |
| Constructor Detail |
|---|
public SelfSignedCertificate()
| Method Detail |
|---|
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildExceptionpublic void setKeyType(SelfSignedCertificate.KeyType type)
type - type of key that will be generatedpublic void setKeysize(int size)
size - size of the generated keypublic void setHostName(String name)
name - hostname that will appear in the certificate's DNpublic void setPrivateKeyFile(File file)
file - file to which the private key will be writtenpublic void setCertificateFile(File file)
file - file to which the certificate will be writtenpublic void setKeystoreFile(File file)
file - file to which the keystore will be writtenpublic void setKeystorePassword(String password)
password - password for the generated keystorepublic void setDnsSubjectAltNames(String altNames)
altNames - space delimited set of subject alt names.public void setUriSubjectAltNames(String altNames)
altNames - space delimited set of subject alt names.
protected void validate()
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException
protected KeyPair generateKeyPair()
throws org.apache.tools.ant.BuildException
org.apache.tools.ant.BuildException - thrown if there is a problem generating the keys.
protected X509Certificate generateCertificate(KeyPair keypair)
throws org.apache.tools.ant.BuildException
keypair - keypair associated with the certificate
org.apache.tools.ant.BuildException - thrown if the certificate can not be generatedprotected org.bouncycastle.asn1.ASN1Encodable[] buildSubjectAltNames()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||