Class ProfileCLI


  • public class ProfileCLI
    extends CLI
    • Constructor Detail

      • ProfileCLI

        public ProfileCLI​(CLI parent)
    • Method Detail

      • getFullName

        public java.lang.String getFullName()
        Overrides:
        getFullName in class CLI
      • getManPage

        public java.lang.String getManPage()
        Overrides:
        getManPage in class CLI
      • getProfileClient

        public ProfileClient getProfileClient()
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • printProfileDataInfo

        public static void printProfileDataInfo​(ProfileDataInfo info)
      • printProfile

        public static void printProfile​(ProfileData data,
                                        java.net.URI baseUri)
      • saveProfileToFile

        public static void saveProfileToFile​(java.lang.String filename,
                                             ProfileData data)
                                      throws javax.xml.bind.JAXBException,
                                             java.io.FileNotFoundException
        Throws:
        javax.xml.bind.JAXBException
        java.io.FileNotFoundException
      • readProfileFromFile

        public static ProfileData readProfileFromFile​(java.lang.String filename)
                                               throws javax.xml.bind.JAXBException,
                                                      java.io.FileNotFoundException
        Throws:
        javax.xml.bind.JAXBException
        java.io.FileNotFoundException
      • readRawProfileFromFile

        public static byte[] readRawProfileFromFile​(java.nio.file.Path path)
                                             throws PKIException,
                                                    java.io.IOException
        Reads a raw profile from the specified file.
        Throws:
        PKIException - if it doesn't parse as a Properties or if it doesn't contain the profileId field.
        java.io.IOException
      • readRawProfileFromFile

        public static byte[] readRawProfileFromFile​(java.lang.String path)
                                             throws PKIException,
                                                    java.io.IOException
        Reads a raw profile from the specified file.
        Throws:
        PKIException - if it doesn't parse as a Properties or if it doesn't contain the profileId field.
        java.io.IOException
      • checkConfiguration

        public static void checkConfiguration​(byte[] in,
                                              boolean requireProfileId,
                                              boolean requireDisabled)
                                       throws PKIException
        Sanity check the profile configuration. We are working with plain byte[] because java.util.Properties has undesirable (i.e. bug-causing) escaping behaviour (it inserts backslashes in places we don't want them). But we do still want to check that the input looks something like a profile configuration. So we use java.util.Properties to do that.
        Throws:
        PKIException
      • saveEnrollmentTemplateToFile

        public static void saveEnrollmentTemplateToFile​(java.lang.String filename,
                                                        CertEnrollmentRequest request)
                                                 throws javax.xml.bind.JAXBException,
                                                        java.io.FileNotFoundException
        Throws:
        javax.xml.bind.JAXBException
        java.io.FileNotFoundException
      • printEnrollmentTemplate

        public static void printEnrollmentTemplate​(CertEnrollmentRequest request)