Class SshKeyGen


  • public class SshKeyGen
    extends AbstractBinary
    Wrapper for the ssh-keygen binary.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • 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
    • Constructor Detail

      • SshKeyGen

        public SshKeyGen()
    • Method Detail

      • 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:
        outputCommandline in class AbstractBinary
        Parameters:
        value - true if to output commandline
        Returns:
        itself
      • options

        public java.util.List<java.lang.String> options()
                                                 throws java.lang.Exception
        Assembles the arguments for the binary.
        Specified by:
        options in class AbstractBinary
        Returns:
        the options
        Throws:
        java.lang.Exception - if failed to determine binary
      • commandLineArgs

        public java.util.List<java.lang.String> commandLineArgs()
                                                         throws java.lang.Exception
        Assembles the full command-line arguments.
        Specified by:
        commandLineArgs in class AbstractBinary
        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:
        description in class AbstractBinary
        Returns:
        the description
      • getParser

        protected net.sourceforge.argparse4j.inf.ArgumentParser getParser()
        Configures and returns the commandline parser.
        Overrides:
        getParser in class AbstractBinary
        Returns:
        the parser
      • setOptions

        protected boolean setOptions​(net.sourceforge.argparse4j.inf.Namespace ns)
        Sets the parsed options.
        Overrides:
        setOptions in class AbstractBinary
        Parameters:
        ns - the parsed options
        Returns:
        if successfully set
      • main

        public static void main​(java.lang.String[] args)
                         throws java.lang.Exception
        For running from the command-line.
        Parameters:
        args - the arguments
        Throws:
        java.lang.Exception