Package com.github.fracpete.rsync4j
Class SshKeyGen
- java.lang.Object
-
- com.github.fracpete.rsync4j.core.AbstractBinary
-
- com.github.fracpete.rsync4j.SshKeyGen
-
public class SshKeyGen extends AbstractBinary
Wrapper for the ssh-keygen binary.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description protected intbitsprotected booleanbubbleBabbleprotected java.lang.StringcandidatePrimesprotected java.lang.StringcertificateIdentityprotected booleanchangePassPhraseprotected java.lang.Stringcommentprotected booleancreateHostCertificateprotected booleanexportprotected java.util.List<java.lang.String>fileprotected java.lang.StringfindHostprotected java.lang.Stringfingerprintprotected booleanforAllprotected booleangenerateKRLprotected java.lang.Stringgeneratorprotected booleangenericDnsFormatprotected booleanhashKnownHostsprotected booleanimportUnencryptedprotected java.lang.StringkeyFileprotected java.lang.StringkeyFormatprotected java.lang.StringkeyTypeprotected intmemoryprotected java.lang.StringnewPassPhraseprotected java.util.List<java.lang.String>optionprotected java.lang.StringpassPhraseprotected java.lang.Stringpkcs11protected java.lang.Stringprincipalsprotected booleanprintContentsprotected java.lang.StringprintFingerprintprotected booleanquietprotected booleanreadPrivatePrintPublicOpenSshprotected java.lang.StringremoveKeysprotected introundsprotected java.lang.StringscreenCheckPointprotected intscreenNumLinesprotected intscreenStartLineprotected java.lang.StringserialNumberprotected booleanshowFingerprintprotected java.lang.StringsignCaKeyprotected java.lang.StringstartPointprotected java.lang.StringtestCandidatePrimesprotected booleantestRevokedprotected booleanupdateKRLprotected booleanuseOpenSshFormatprotected java.lang.StringvalidityIntervalprotected intverbose-
Fields inherited from class com.github.fracpete.rsync4j.core.AbstractBinary
logger, outputCommandline, outputSingleCommandline
-
-
Constructor Summary
Constructors Constructor Description SshKeyGen()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SshKeyGenbits(int value)ssh-keygen option: -bSshKeyGenbubbleBabble(boolean value)ssh-keygen option: -BSshKeyGencandidatePrimes(java.lang.String value)ssh-keygen option: -GSshKeyGencertificateIdentity(java.lang.String value)ssh-keygen option: -ISshKeyGenchangePassPhrase(boolean value)ssh-keygen option: -pjava.util.List<java.lang.String>commandLineArgs()Assembles the full command-line arguments.SshKeyGencomment(java.lang.String value)ssh-keygen option: -CSshKeyGencreateHostCertificate(boolean value)ssh-keygen option: -hprotected java.lang.Stringdescription()Returns a short description for the binary.SshKeyGenexport(boolean value)ssh-keygen option: -eSshKeyGenfile(java.lang.String... value)SshKeyGenfile(java.util.List<java.lang.String> value)SshKeyGenfindHost(java.lang.String value)ssh-keygen option: -FSshKeyGenfingerprint(java.lang.String value)ssh-keygen option: -ESshKeyGenforAll(boolean value)ssh-keygen option: -ASshKeyGengenerateKRL(boolean value)ssh-keygen option: -kSshKeyGengenerator(java.lang.String value)ssh-keygen option: -WSshKeyGengenericDnsFormat(boolean value)ssh-keygen option: -gintgetBits()ssh-keygen option: -bjava.lang.StringgetCandidatePrimes()ssh-keygen option: -Gjava.lang.StringgetCertificateIdentity()ssh-keygen option: -Ijava.lang.StringgetComment()ssh-keygen option: -Cjava.util.List<java.lang.String>getFile()java.lang.StringgetFindHost()ssh-keygen option: -Fjava.lang.StringgetFingerprint()ssh-keygen option: -Ejava.lang.StringgetGenerator()ssh-keygen option: -Wjava.lang.StringgetKeyFile()ssh-keygen option: -fjava.lang.StringgetKeyFormat()ssh-keygen option: -mjava.lang.StringgetKeyType()ssh-keygen option: -tintgetMemory()ssh-keygen option: -Mjava.lang.StringgetNewPassPhrase()ssh-keygen option: -Njava.util.List<java.lang.String>getOption()ssh-keygen option: -Oprotected net.sourceforge.argparse4j.inf.ArgumentParsergetParser()Configures and returns the commandline parser.java.lang.StringgetPassPhrase()ssh-keygen option: -Pjava.lang.StringgetPkcs11()ssh-keygen option: -Djava.lang.StringgetPrincipals()ssh-keygen option: -njava.lang.StringgetPrintFingerprint()ssh-keygen option: -rjava.lang.StringgetRemoveKeys()ssh-keygen option: -RintgetRounds()ssh-keygen option: -ajava.lang.StringgetScreenCheckPoint()ssh-keygen option: -KintgetScreenNumLines()ssh-keygen option: -JintgetScreenStartLine()ssh-keygen option: -jjava.lang.StringgetSerialNumber()ssh-keygen option: -zjava.lang.StringgetSignCaKey()ssh-keygen option: -sjava.lang.StringgetStartPoint()ssh-keygen option: -Sjava.lang.StringgetTestCandidatePrimes()ssh-keygen option: -Tjava.lang.StringgetValidityInterval()ssh-keygen option: -VintgetVerbose()ssh-keygen option: -v/-vv/-vvvSshKeyGenhashKnownHosts(boolean value)ssh-keygen option: -HSshKeyGenimportUnencrypted(boolean value)ssh-keygen option: -ibooleanisBubbleBabble()ssh-keygen option: -BbooleanisChangePassPhrase()ssh-keygen option: -pbooleanisCreateHostCertificate()ssh-keygen option: -hbooleanisExport()ssh-keygen option: -ebooleanisForAll()ssh-keygen option: -AbooleanisGenerateKRL()ssh-keygen option: -kbooleanisGenericDnsFormat()ssh-keygen option: -gbooleanisHashKnownHosts()ssh-keygen option: -HbooleanisImportUnencrypted()ssh-keygen option: -ibooleanisPrintContents()ssh-keygen option: -LbooleanisQuiet()ssh-keygen option: -qbooleanisReadPrivatePrintPublicOpenSsh()ssh-keygen option: -ybooleanisShowFingerprint()ssh-keygen option: -lbooleanisTestRevoked()ssh-keygen option: -QbooleanisUpdateKRL()ssh-keygen option: -ubooleanisUseOpenSshFormat()ssh-keygen option: -oSshKeyGenkeyFile(java.lang.String value)ssh-keygen option: -fSshKeyGenkeyFormat(java.lang.String value)ssh-keygen option: -mSshKeyGenkeyType(java.lang.String value)ssh-keygen option: -tstatic voidmain(java.lang.String[] args)For running from the command-line.SshKeyGenmemory(int value)ssh-keygen option: -MSshKeyGennewPassPhrase(java.lang.String value)ssh-keygen option: -NSshKeyGenoption(java.lang.String... value)ssh-keygen option: -OSshKeyGenoption(java.util.List<java.lang.String> value)ssh-keygen option: -Ojava.util.List<java.lang.String>options()Assembles the arguments for the binary.SshKeyGenoutputCommandline(boolean value)Sets output commandline flag.SshKeyGenpassPhrase(java.lang.String value)ssh-keygen option: -PSshKeyGenpkcs11(java.lang.String value)ssh-keygen option: -DSshKeyGenprincipals(java.lang.String value)ssh-keygen option: -nSshKeyGenprintContents(boolean value)ssh-keygen option: -LSshKeyGenprintFingerprint(java.lang.String value)ssh-keygen option: -rSshKeyGenquiet(boolean value)ssh-keygen option: -qSshKeyGenreadPrivatePrintPublicOpenSsh(boolean value)ssh-keygen option: -ySshKeyGenremoveKeys(java.lang.String value)ssh-keygen option: -Rvoidreset()Resets the members.SshKeyGenrounds(int value)ssh-keygen option: -aSshKeyGenscreenCheckPoint(java.lang.String value)ssh-keygen option: -KSshKeyGenscreenNumLines(int value)ssh-keygen option: -JSshKeyGenscreenStartLine(int value)ssh-keygen option: -jSshKeyGenserialNumber(java.lang.String value)ssh-keygen option: -zprotected booleansetOptions(net.sourceforge.argparse4j.inf.Namespace ns)Sets the parsed options.SshKeyGenshowFingerprint(boolean value)ssh-keygen option: -lSshKeyGensignCaKey(java.lang.String value)ssh-keygen option: -sSshKeyGenstartPoint(java.lang.String value)ssh-keygen option: -SSshKeyGentestCandidatePrimes(java.lang.String value)ssh-keygen option: -TSshKeyGentestRevoked(boolean value)ssh-keygen option: -QSshKeyGenupdateKRL(boolean value)ssh-keygen option: -uSshKeyGenuseOpenSshFormat(boolean value)ssh-keygen option: -oSshKeyGenvalidityInterval(java.lang.String value)ssh-keygen option: -VSshKeyGenverbose(int value)ssh-keygen option: -v/-vv/-vvv-
Methods inherited from class com.github.fracpete.rsync4j.core.AbstractBinary
builder, commandLine, execute, getOutputCommandline, getOutputSingleCommandline, outputSingleCommandline, run, setOptions, start
-
-
-
-
Field Detail
-
forAll
protected boolean forAll
-
rounds
protected int rounds
-
bubbleBabble
protected boolean bubbleBabble
-
bits
protected int bits
-
comment
protected java.lang.String comment
-
pkcs11
protected java.lang.String pkcs11
-
fingerprint
protected java.lang.String fingerprint
-
export
protected boolean export
-
findHost
protected java.lang.String findHost
-
keyFile
protected java.lang.String keyFile
-
candidatePrimes
protected java.lang.String candidatePrimes
-
genericDnsFormat
protected boolean genericDnsFormat
-
hashKnownHosts
protected boolean hashKnownHosts
-
createHostCertificate
protected boolean createHostCertificate
-
certificateIdentity
protected java.lang.String certificateIdentity
-
importUnencrypted
protected boolean importUnencrypted
-
screenNumLines
protected int screenNumLines
-
screenStartLine
protected int screenStartLine
-
screenCheckPoint
protected java.lang.String screenCheckPoint
-
generateKRL
protected boolean generateKRL
-
printContents
protected boolean printContents
-
showFingerprint
protected boolean showFingerprint
-
memory
protected int memory
-
keyFormat
protected java.lang.String keyFormat
-
newPassPhrase
protected java.lang.String newPassPhrase
-
principals
protected java.lang.String principals
-
option
protected java.util.List<java.lang.String> option
-
useOpenSshFormat
protected boolean useOpenSshFormat
-
passPhrase
protected java.lang.String passPhrase
-
changePassPhrase
protected boolean changePassPhrase
-
testRevoked
protected boolean testRevoked
-
quiet
protected boolean quiet
-
removeKeys
protected java.lang.String removeKeys
-
printFingerprint
protected java.lang.String printFingerprint
-
startPoint
protected java.lang.String startPoint
-
signCaKey
protected java.lang.String signCaKey
-
testCandidatePrimes
protected java.lang.String testCandidatePrimes
-
keyType
protected java.lang.String keyType
-
updateKRL
protected boolean updateKRL
-
validityInterval
protected java.lang.String validityInterval
-
verbose
protected int verbose
-
generator
protected java.lang.String generator
-
readPrivatePrintPublicOpenSsh
protected boolean readPrivatePrintPublicOpenSsh
-
serialNumber
protected java.lang.String serialNumber
-
file
protected java.util.List<java.lang.String> file
-
-
Method Detail
-
reset
public void reset()
Resets the members.- Overrides:
resetin classAbstractBinary
-
forAll
public SshKeyGen forAll(boolean value)
ssh-keygen option: -A
-
isForAll
public boolean isForAll()
ssh-keygen option: -A
-
rounds
public SshKeyGen rounds(int value)
ssh-keygen option: -a
-
getRounds
public int getRounds()
ssh-keygen option: -a
-
bubbleBabble
public SshKeyGen bubbleBabble(boolean value)
ssh-keygen option: -B
-
isBubbleBabble
public boolean isBubbleBabble()
ssh-keygen option: -B
-
bits
public SshKeyGen bits(int value)
ssh-keygen option: -b
-
getBits
public int getBits()
ssh-keygen option: -b
-
comment
public SshKeyGen comment(java.lang.String value)
ssh-keygen option: -C
-
getComment
public java.lang.String getComment()
ssh-keygen option: -C
-
pkcs11
public SshKeyGen pkcs11(java.lang.String value)
ssh-keygen option: -D
-
getPkcs11
public java.lang.String getPkcs11()
ssh-keygen option: -D
-
fingerprint
public SshKeyGen fingerprint(java.lang.String value)
ssh-keygen option: -E
-
getFingerprint
public java.lang.String getFingerprint()
ssh-keygen option: -E
-
export
public SshKeyGen export(boolean value)
ssh-keygen option: -e
-
isExport
public boolean isExport()
ssh-keygen option: -e
-
findHost
public SshKeyGen findHost(java.lang.String value)
ssh-keygen option: -F
-
getFindHost
public java.lang.String getFindHost()
ssh-keygen option: -F
-
keyFile
public SshKeyGen keyFile(java.lang.String value)
ssh-keygen option: -f
-
getKeyFile
public java.lang.String getKeyFile()
ssh-keygen option: -f
-
candidatePrimes
public SshKeyGen candidatePrimes(java.lang.String value)
ssh-keygen option: -G
-
getCandidatePrimes
public java.lang.String getCandidatePrimes()
ssh-keygen option: -G
-
genericDnsFormat
public SshKeyGen genericDnsFormat(boolean value)
ssh-keygen option: -g
-
isGenericDnsFormat
public boolean isGenericDnsFormat()
ssh-keygen option: -g
-
hashKnownHosts
public SshKeyGen hashKnownHosts(boolean value)
ssh-keygen option: -H
-
isHashKnownHosts
public boolean isHashKnownHosts()
ssh-keygen option: -H
-
createHostCertificate
public SshKeyGen createHostCertificate(boolean value)
ssh-keygen option: -h
-
isCreateHostCertificate
public boolean isCreateHostCertificate()
ssh-keygen option: -h
-
certificateIdentity
public SshKeyGen certificateIdentity(java.lang.String value)
ssh-keygen option: -I
-
getCertificateIdentity
public java.lang.String getCertificateIdentity()
ssh-keygen option: -I
-
importUnencrypted
public SshKeyGen importUnencrypted(boolean value)
ssh-keygen option: -i
-
isImportUnencrypted
public boolean isImportUnencrypted()
ssh-keygen option: -i
-
screenNumLines
public SshKeyGen screenNumLines(int value)
ssh-keygen option: -J
-
getScreenNumLines
public int getScreenNumLines()
ssh-keygen option: -J
-
screenStartLine
public SshKeyGen screenStartLine(int value)
ssh-keygen option: -j
-
getScreenStartLine
public int getScreenStartLine()
ssh-keygen option: -j
-
screenCheckPoint
public SshKeyGen screenCheckPoint(java.lang.String value)
ssh-keygen option: -K
-
getScreenCheckPoint
public java.lang.String getScreenCheckPoint()
ssh-keygen option: -K
-
generateKRL
public SshKeyGen generateKRL(boolean value)
ssh-keygen option: -k
-
isGenerateKRL
public boolean isGenerateKRL()
ssh-keygen option: -k
-
printContents
public SshKeyGen printContents(boolean value)
ssh-keygen option: -L
-
isPrintContents
public boolean isPrintContents()
ssh-keygen option: -L
-
showFingerprint
public SshKeyGen showFingerprint(boolean value)
ssh-keygen option: -l
-
isShowFingerprint
public boolean isShowFingerprint()
ssh-keygen option: -l
-
memory
public SshKeyGen memory(int value)
ssh-keygen option: -M
-
getMemory
public int getMemory()
ssh-keygen option: -M
-
keyFormat
public SshKeyGen keyFormat(java.lang.String value)
ssh-keygen option: -m
-
getKeyFormat
public java.lang.String getKeyFormat()
ssh-keygen option: -m
-
newPassPhrase
public SshKeyGen newPassPhrase(java.lang.String value)
ssh-keygen option: -N
-
getNewPassPhrase
public java.lang.String getNewPassPhrase()
ssh-keygen option: -N
-
principals
public SshKeyGen principals(java.lang.String value)
ssh-keygen option: -n
-
getPrincipals
public java.lang.String getPrincipals()
ssh-keygen option: -n
-
option
public SshKeyGen option(java.lang.String... value)
ssh-keygen option: -O
-
option
public SshKeyGen option(java.util.List<java.lang.String> value)
ssh-keygen option: -O
-
getOption
public java.util.List<java.lang.String> getOption()
ssh-keygen option: -O
-
useOpenSshFormat
public SshKeyGen useOpenSshFormat(boolean value)
ssh-keygen option: -o
-
isUseOpenSshFormat
public boolean isUseOpenSshFormat()
ssh-keygen option: -o
-
passPhrase
public SshKeyGen passPhrase(java.lang.String value)
ssh-keygen option: -P
-
getPassPhrase
public java.lang.String getPassPhrase()
ssh-keygen option: -P
-
changePassPhrase
public SshKeyGen changePassPhrase(boolean value)
ssh-keygen option: -p
-
isChangePassPhrase
public boolean isChangePassPhrase()
ssh-keygen option: -p
-
testRevoked
public SshKeyGen testRevoked(boolean value)
ssh-keygen option: -Q
-
isTestRevoked
public boolean isTestRevoked()
ssh-keygen option: -Q
-
quiet
public SshKeyGen quiet(boolean value)
ssh-keygen option: -q
-
isQuiet
public boolean isQuiet()
ssh-keygen option: -q
-
removeKeys
public SshKeyGen removeKeys(java.lang.String value)
ssh-keygen option: -R
-
getRemoveKeys
public java.lang.String getRemoveKeys()
ssh-keygen option: -R
-
printFingerprint
public SshKeyGen printFingerprint(java.lang.String value)
ssh-keygen option: -r
-
getPrintFingerprint
public java.lang.String getPrintFingerprint()
ssh-keygen option: -r
-
startPoint
public SshKeyGen startPoint(java.lang.String value)
ssh-keygen option: -S
-
getStartPoint
public java.lang.String getStartPoint()
ssh-keygen option: -S
-
signCaKey
public SshKeyGen signCaKey(java.lang.String value)
ssh-keygen option: -s
-
getSignCaKey
public java.lang.String getSignCaKey()
ssh-keygen option: -s
-
testCandidatePrimes
public SshKeyGen testCandidatePrimes(java.lang.String value)
ssh-keygen option: -T
-
getTestCandidatePrimes
public java.lang.String getTestCandidatePrimes()
ssh-keygen option: -T
-
keyType
public SshKeyGen keyType(java.lang.String value)
ssh-keygen option: -t
-
getKeyType
public java.lang.String getKeyType()
ssh-keygen option: -t
-
updateKRL
public SshKeyGen updateKRL(boolean value)
ssh-keygen option: -u
-
isUpdateKRL
public boolean isUpdateKRL()
ssh-keygen option: -u
-
validityInterval
public SshKeyGen validityInterval(java.lang.String value)
ssh-keygen option: -V
-
getValidityInterval
public java.lang.String getValidityInterval()
ssh-keygen option: -V
-
verbose
public SshKeyGen verbose(int value)
ssh-keygen option: -v/-vv/-vvv
-
getVerbose
public int getVerbose()
ssh-keygen option: -v/-vv/-vvv
-
generator
public SshKeyGen generator(java.lang.String value)
ssh-keygen option: -W
-
getGenerator
public java.lang.String getGenerator()
ssh-keygen option: -W
-
readPrivatePrintPublicOpenSsh
public SshKeyGen readPrivatePrintPublicOpenSsh(boolean value)
ssh-keygen option: -y
-
isReadPrivatePrintPublicOpenSsh
public boolean isReadPrivatePrintPublicOpenSsh()
ssh-keygen option: -y
-
serialNumber
public SshKeyGen serialNumber(java.lang.String value)
ssh-keygen option: -z
-
getSerialNumber
public java.lang.String getSerialNumber()
ssh-keygen option: -z
-
file
public SshKeyGen file(java.lang.String... value)
-
file
public SshKeyGen file(java.util.List<java.lang.String> value)
-
getFile
public java.util.List<java.lang.String> getFile()
-
outputCommandline
public SshKeyGen outputCommandline(boolean value)
Sets output commandline flag.- Overrides:
outputCommandlinein classAbstractBinary- Parameters:
value- true if to output commandline- Returns:
- itself
-
options
public java.util.List<java.lang.String> options() throws java.lang.ExceptionAssembles the arguments for the binary.- Specified by:
optionsin classAbstractBinary- Returns:
- the options
- Throws:
java.lang.Exception- if failed to determine binary
-
commandLineArgs
public java.util.List<java.lang.String> commandLineArgs() throws java.lang.ExceptionAssembles the full command-line arguments.- Specified by:
commandLineArgsin classAbstractBinary- Returns:
- the command-line arguments
- Throws:
java.lang.Exception- if failed to determine binary- See Also:
options()
-
description
protected java.lang.String description()
Returns a short description for the binary.- Specified by:
descriptionin classAbstractBinary- Returns:
- the description
-
getParser
protected net.sourceforge.argparse4j.inf.ArgumentParser getParser()
Configures and returns the commandline parser.- Overrides:
getParserin classAbstractBinary- Returns:
- the parser
-
setOptions
protected boolean setOptions(net.sourceforge.argparse4j.inf.Namespace ns)
Sets the parsed options.- Overrides:
setOptionsin classAbstractBinary- Parameters:
ns- the parsed options- Returns:
- if successfully set
-
main
public static void main(java.lang.String[] args) throws java.lang.ExceptionFor running from the command-line.- Parameters:
args- the arguments- Throws:
java.lang.Exception
-
-