Class CreateKeyPair

All Implemented Interfaces:
ConsoleOutput, Callable<Integer>
Direct Known Subclasses:
CreateAccount

@Prototype public class CreateKeyPair extends CodeGenCommand
Allows for generating a keypair in a given location with a given size.

Alternative to using this is using openssl : `openssl genrsa -out /tmp/mydomain.com-key.pem 4096`

  • Field Details

    • keyDir

      protected String keyDir
    • keyName

      protected String keyName
    • keySize

      protected int keySize
  • Constructor Details

  • Method Details

    • applies

      public boolean applies()
      Specified by:
      applies in class CodeGenCommand
    • call

      public Integer call()
      Uses arguments passed to do all keypair creation.
      Returns:
      exit code of the program
    • doKeyCreation

      protected KeyPair doKeyCreation(String keyLocation, String keyName, boolean overwrite) throws IOException
      Create a keypair with a default size of 4096 bits.
      Parameters:
      keyLocation - output directory for key
      keyName - name of keypair file
      Returns:
      keypair
      Throws:
      IOException - Failed to get/create keypair from disk