Package com.netscape.cmstools.profile
Class ProfileCLI
- java.lang.Object
-
- org.dogtagpki.cli.CLI
-
- com.netscape.cmstools.profile.ProfileCLI
-
public class ProfileCLI extends CLI
-
-
Field Summary
Fields Modifier and Type Field Description CACLIcaCLIstatic org.slf4j.LoggerloggerProfileClientprofileClient
-
Constructor Summary
Constructors Constructor Description ProfileCLI(CACLI caCLI)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckConfiguration(byte[] in, boolean requireProfileId, boolean requireDisabled)Sanity check the profile configuration.java.lang.StringgetFullName()java.lang.StringgetManPage()ProfileClientgetProfileClient()static voidprintEnrollmentTemplate(CertEnrollmentRequest request)static voidprintProfile(ProfileData data, java.net.URI baseUri)static voidprintProfileDataInfo(ProfileDataInfo info)static ProfileDatareadProfileFromFile(java.lang.String filename)static byte[]readRawProfileFromFile(java.lang.String path)Reads a raw profile from the specified file.static byte[]readRawProfileFromFile(java.nio.file.Path path)Reads a raw profile from the specified file.static voidsaveEnrollmentTemplateToFile(java.lang.String filename, CertEnrollmentRequest request)static voidsaveProfileToFile(java.lang.String filename, ProfileData data)-
Methods inherited from class org.dogtagpki.cli.CLI
addModule, execute, findModule, findModules, getClient, getClient, getConfig, getDescription, getFullModuleName, getModule, getModules, getName, getParent, getRoot, isDeprecated, printCommands, printHelp, removeModule, runExternal, runExternal, setDescription, setName
-
-
-
-
Field Detail
-
logger
public static org.slf4j.Logger logger
-
caCLI
public CACLI caCLI
-
profileClient
public ProfileClient profileClient
-
-
Constructor Detail
-
ProfileCLI
public ProfileCLI(CACLI caCLI)
-
-
Method Detail
-
getFullName
public java.lang.String getFullName()
- Overrides:
getFullNamein classCLI
-
getManPage
public java.lang.String getManPage()
- Overrides:
getManPagein classCLI
-
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.JAXBExceptionjava.io.FileNotFoundException
-
readProfileFromFile
public static ProfileData readProfileFromFile(java.lang.String filename) throws javax.xml.bind.JAXBException, java.io.FileNotFoundException
- Throws:
javax.xml.bind.JAXBExceptionjava.io.FileNotFoundException
-
readRawProfileFromFile
public static byte[] readRawProfileFromFile(java.nio.file.Path path) throws PKIException, java.io.IOExceptionReads 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.IOExceptionReads 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 PKIExceptionSanity 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.JAXBExceptionjava.io.FileNotFoundException
-
printEnrollmentTemplate
public static void printEnrollmentTemplate(CertEnrollmentRequest request)
-
-