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.String
dname
Distinguished name.private java.lang.String
ext
X.509 extension.private java.lang.String
keyalg
Key algorithm name.private java.lang.String
keypass
Key password.private java.lang.String
keysize
Key bit size.private java.lang.String
sigalg
Signature algorithm name.private boolean
skipIfExist
If value istrue
, then will do nothing if keystore already exists.private java.lang.String
startdate
Certificate validity start date/time.private java.lang.String
validity
Validity 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 KeyToolGenerateKeyPairRequest
createKeytoolRequest()
To prepare the incoming request, says fill it with mojo parameters.void
execute()
protected java.lang.String
getCommandlineInfo(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.MojoExecutionException
Description copied from class:AbstractKeyToolRequestMojo
- Specified by:
execute
in interfaceorg.apache.maven.plugin.Mojo
- Overrides:
execute
in classAbstractKeyToolRequestMojo<KeyToolGenerateKeyPairRequest>
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
createKeytoolRequest
protected KeyToolGenerateKeyPairRequest createKeytoolRequest()
To prepare the incoming request, says fill it with mojo parameters.- Overrides:
createKeytoolRequest
in 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:
getCommandlineInfo
in classAbstractKeyToolRequestWithKeyStoreParametersMojo<KeyToolGenerateKeyPairRequest>
- Parameters:
commandLine
- TheCommandline
to get a string representation of (can not be null).- Returns:
- The string representation of
commandLine
.
-
-