Package rs.baselib.licensing
Class KeyGen
java.lang.Object
rs.baselib.licensing.KeyGen
- All Implemented Interfaces:
java.lang.Runnable
public class KeyGen
extends java.lang.Object
implements java.lang.Runnable
A RSA Key Generator.
- Author:
- ralph
-
Constructor Summary
Constructors Constructor Description KeyGen(java.lang.String algorithm, int length, java.lang.String file, boolean overwrite) -
Method Summary
Modifier and Type Method Description java.lang.StringgetAlgorithm()Returns thealgorithm.java.lang.StringgetFile()Returns thefile.java.security.KeyPairgetKeyPair()Returns thekeyPair.intgetLength()Returns thelength.protected static OptionsgetOptions()Creates the CLI options.booleanisOverwrite()Returns theoverwrite.static voidmain(java.lang.String[] args)CLI.protected static voidprintHelp(Options options)Prints the CLI help text.voidrun()Generates and saved the key.
-
Constructor Details
-
KeyGen
public KeyGen(java.lang.String algorithm, int length, java.lang.String file, boolean overwrite)
-
-
Method Details
-
getAlgorithm
public java.lang.String getAlgorithm()Returns thealgorithm.- Returns:
- the algorithm
-
getLength
public int getLength()Returns thelength.- Returns:
- the length
-
getFile
public java.lang.String getFile()Returns thefile.- Returns:
- the file
-
getKeyPair
public java.security.KeyPair getKeyPair()Returns thekeyPair.- Returns:
- the keyPair
-
isOverwrite
public boolean isOverwrite()Returns theoverwrite.- Returns:
- the overwrite
-
run
public void run()Generates and saved the key.- Specified by:
runin interfacejava.lang.Runnable
-
main
public static void main(java.lang.String[] args)CLI.- Parameters:
args- - the command line arguments
-
printHelp
Prints the CLI help text.- Parameters:
options- options for CLI
-
getOptions
Creates the CLI options.- Returns:
- the CLI options
-