Class CreateKeyPair
java.lang.Object
io.micronaut.starter.cli.command.BaseCommand
io.micronaut.starter.cli.command.CodeGenCommand
io.micronaut.starter.cli.feature.acme.CreateKeyPair
- All Implemented Interfaces:
- ConsoleOutput,- Callable<Integer>
- Direct Known Subclasses:
- CreateAccount
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 SummaryFieldsFields inherited from class io.micronaut.starter.cli.command.CodeGenCommandbeanContext, config, consoleOutput, outputHandlerSupplier, overwriteFields inherited from class io.micronaut.starter.cli.command.BaseCommandcommonOptions, specFields inherited from interface io.micronaut.starter.io.ConsoleOutputNOOP
- 
Constructor SummaryConstructorsConstructorDescriptionCreateKeyPair(CodeGenConfig config) CreateKeyPair(CodeGenConfig config, io.micronaut.core.util.functional.ThrowingSupplier<OutputHandler, IOException> outputHandlerSupplier, ConsoleOutput consoleOutput) 
- 
Method SummaryMethods inherited from class io.micronaut.starter.cli.command.CodeGenCommanderr, getCommand, getProject, getTemplateRenderer, getTemplateRenderer, out, setBeanContext, warningMethods inherited from class io.micronaut.starter.cli.command.BaseCommanderrWriter, getOperatingSystem, getSpec, green, outWriter, red, showStacktrace, verbose
- 
Field Details- 
keyDir
- 
keyName
- 
keySizeprotected int keySize
 
- 
- 
Constructor Details- 
CreateKeyPair
- 
CreateKeyPairpublic CreateKeyPair(CodeGenConfig config, io.micronaut.core.util.functional.ThrowingSupplier<OutputHandler, IOException> outputHandlerSupplier, ConsoleOutput consoleOutput) 
 
- 
- 
Method Details- 
appliespublic boolean applies()- Specified by:
- appliesin class- CodeGenCommand
 
- 
callUses arguments passed to do all keypair creation.- Returns:
- exit code of the program
 
- 
doKeyCreationprotected 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
 
 
-