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.String getAlgorithm()
    Returns the algorithm.
    java.lang.String getFile()
    Returns the file.
    java.security.KeyPair getKeyPair()
    Returns the keyPair.
    int getLength()
    Returns the length.
    protected static Options getOptions()
    Creates the CLI options.
    boolean isOverwrite()
    Returns the overwrite.
    static void main​(java.lang.String[] args)
    CLI.
    protected static void printHelp​(Options options)
    Prints the CLI help text.
    void run()
    Generates and saved the key.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 the algorithm.
      Returns:
      the algorithm
    • getLength

      public int getLength()
      Returns the length.
      Returns:
      the length
    • getFile

      public java.lang.String getFile()
      Returns the file.
      Returns:
      the file
    • getKeyPair

      public java.security.KeyPair getKeyPair()
      Returns the keyPair.
      Returns:
      the keyPair
    • isOverwrite

      public boolean isOverwrite()
      Returns the overwrite.
      Returns:
      the overwrite
    • run

      public void run()
      Generates and saved the key.
      Specified by:
      run in interface java.lang.Runnable
    • main

      public static void main​(java.lang.String[] args)
      CLI.
      Parameters:
      args - - the command line arguments
    • printHelp

      protected static void printHelp​(Options options)
      Prints the CLI help text.
      Parameters:
      options - options for CLI
    • getOptions

      protected static Options getOptions()
      Creates the CLI options.
      Returns:
      the CLI options