Package org.codehaus.mojo.keytool
Class GenerateKeyPairMojo
- java.lang.Object
-
- org.apache.maven.plugin.AbstractMojo
-
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="generateKeyPair", requiresProject=true) public class GenerateKeyPairMojo extends AbstractKeyToolRequestWithKeyStoreAndAliasParametersMojo<KeyToolGenerateKeyPairRequest>To generate a key pair into a keystore. Implemented as a wrapper around the SDKkeytool -genkey(jdk 1.5)keytool -genkeypair(jdk 1.6) command. See keystore documentation.- Since:
- 1.2
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringdnameDistinguished name.private java.lang.StringextX.509 extension.private java.lang.StringkeyalgKey algorithm name.private java.lang.StringkeypassKey password.private java.lang.StringkeysizeKey bit size.private java.lang.StringsigalgSignature algorithm name.private booleanskipIfExistIf value istrue, then will do nothing if keystore already exists.private java.lang.StringstartdateCertificate validity start date/time.private java.lang.StringvalidityValidity number of days.
-
Constructor Summary
Constructors Constructor Description GenerateKeyPairMojo()Default contructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected KeyToolGenerateKeyPairRequestcreateKeytoolRequest()To prepare the incoming request, says fill it with mojo parameters.voidexecute()protected java.lang.StringgetCommandlineInfo(org.apache.maven.shared.utils.cli.Commandline commandLine)Gets a string representation of aCommandline.-
Methods inherited from class org.codehaus.mojo.keytool.AbstractKeyToolRequestWithKeyStoreParametersMojo
createParentDirIfNecessary, getFile, getKeystoreFile
-
Methods inherited from class org.codehaus.mojo.keytool.AbstractKeyToolRequestMojo
consumeResult
-
Methods inherited from class org.codehaus.mojo.keytool.AbstractKeyToolMojo
getMessage, getMessage, getMessage, isSkip, isVerbose, setSkip, setVerbose
-
-
-
-
Field Detail
-
keyalg
@Parameter private java.lang.String keyalg
Key algorithm name. See options.- Since:
- 1.2
-
keysize
@Parameter private java.lang.String keysize
Key bit size. See options.- Since:
- 1.2
-
keypass
@Parameter private java.lang.String keypass
Key password. See options.- Since:
- 1.2
-
sigalg
@Parameter private java.lang.String sigalg
Signature algorithm name. See options.- Since:
- 1.2
-
validity
@Parameter private java.lang.String validity
Validity number of days. See options.- Since:
- 1.2
-
startdate
@Parameter private java.lang.String startdate
Certificate validity start date/time. See options.- Since:
- 1.2
-
ext
@Parameter private java.lang.String ext
X.509 extension. See options.- Since:
- 1.2
-
dname
@Parameter private java.lang.String dname
Distinguished name. See options.- Since:
- 1.2
-
skipIfExist
@Parameter private boolean skipIfExist
If value istrue, then will do nothing if keystore already exists.- Since:
- 1.3
-
-
Method Detail
-
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionExceptionDescription copied from class:AbstractKeyToolRequestMojo- Specified by:
executein interfaceorg.apache.maven.plugin.Mojo- Overrides:
executein classAbstractKeyToolRequestMojo<KeyToolGenerateKeyPairRequest>- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createKeytoolRequest
protected KeyToolGenerateKeyPairRequest createKeytoolRequest()
To prepare the incoming request, says fill it with mojo parameters.- Overrides:
createKeytoolRequestin classAbstractKeyToolRequestWithKeyStoreAndAliasParametersMojo<KeyToolGenerateKeyPairRequest>- Returns:
- the created keytool request
- See Also:
KeyToolRequest
-
getCommandlineInfo
protected java.lang.String getCommandlineInfo(org.apache.maven.shared.utils.cli.Commandline commandLine)
Gets a string representation of aCommandline.This method creates the string representation by calling
commandLine.toString()by default.- Overrides:
getCommandlineInfoin classAbstractKeyToolRequestWithKeyStoreParametersMojo<KeyToolGenerateKeyPairRequest>- Parameters:
commandLine- TheCommandlineto get a string representation of (can not be null).- Returns:
- The string representation of
commandLine.
-
-