Class FileSystemEncryptRealmCommand

  • class FileSystemEncryptRealmCommand
    extends Command
    Elytron-Tool command to convert un-encrypted FileSystemRealms into an encrypted realm with the use of a SecretKey. Also, optionally provides a WildFly CLI script to register the FileSystemRealm and corresponding security-domain in WildFly.
    Ashpan Raskar
    • Constructor Detail

      • FileSystemEncryptRealmCommand

    • Method Detail

      • help

        public void help()
        Displays the help for the command
        help in class Command
      • warningHandler

        private void warningHandler​(String warning)
        Prints out a warning message if silentMode is not enabled and adds the warning to the summary if summaryMode is enabled
        warning - The warning to be shown
      • errorHandler

        private void errorHandler​(Exception e)
                           throws Exception
        Determines if a summary needs to be printed and prints summary after an error is thrown
        e - The exception thrown during execution
        Exception - The exception to be handled by Elytron Tool
      • printDescriptorBlocks

        private void printDescriptorBlocks​(int count)
        Prints out information found in a descriptor file for summary mode
        count - The amount of descriptor blocks in the file
      • getDescriptorParam

        private String getDescriptorParam​(String param,
                                          FileSystemEncryptRealmCommand.Descriptor descriptor)
        Returns the value for a given param in a Descriptor object
        param - The parameter to be obtained from the Descriptor object
        descriptor - The Descriptor object to be used
        The value of the given parameter
      • parseDescriptorFile

        private void parseDescriptorFile​(String file)
                                  throws Exception
        Handles input being given as a descriptor file
        Exception - Exception to be handled by Elytron Tool
      • copyAddResetDescriptor

        private void copyAddResetDescriptor​(FileSystemEncryptRealmCommand.Descriptor original)
        Copies a Descriptor into a temporary one for it can be cloned into the list of descriptors
        original - The original descriptor that is continually modified
      • findMissingRequiredValuesAndSetValues

        private void findMissingRequiredValuesAndSetValues​(int count,
                                                           FileSystemEncryptRealmCommand.Descriptor descriptor)
        Determines if the current descriptor block is missing any required values and then if it is, prints out a warning message and sets that required value and the optional values to null
        count - The index of the current descriptor block
      • createFileSystemRealm

        private void createFileSystemRealm()
                                    throws Exception
        Handles creating the Elytron filesystem-realm from the descriptor array
        Exception - Exception to be handled by Elytron Tool
      • createWildFlyScript

        private void createWildFlyScript()
                                  throws Exception
        Creates the script/commands the user must run for Elytron to recognize and use the new filesystem-realm