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 CACLI
caCLI
static org.slf4j.Logger
logger
ProfileClient
profileClient
-
Constructor Summary
Constructors Constructor Description ProfileCLI(CACLI caCLI)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
checkConfiguration(byte[] in, boolean requireProfileId, boolean requireDisabled)
Sanity check the profile configuration.java.lang.String
getFullName()
java.lang.String
getManPage()
ProfileClient
getProfileClient()
static void
printEnrollmentTemplate(CertEnrollmentRequest request)
static void
printProfile(ProfileData data, java.net.URI baseUri)
static void
printProfileDataInfo(ProfileDataInfo info)
static ProfileData
readProfileFromFile(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 void
saveEnrollmentTemplateToFile(java.lang.String filename, CertEnrollmentRequest request)
static void
saveProfileToFile(java.lang.String filename, ProfileData data)
-
Methods inherited from class org.dogtagpki.cli.CLI
addModule, addModule, execute, findModule, findModules, getClient, getClient, getConfig, getDescription, getFullModuleName, getModule, getModules, getName, getParent, getRoot, isDeprecated, 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:
getFullName
in classCLI
-
getManPage
public java.lang.String getManPage()
- Overrides:
getManPage
in 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 java.lang.Exception
- Throws:
java.lang.Exception
-
readProfileFromFile
public static ProfileData readProfileFromFile(java.lang.String filename) throws java.lang.Exception
- Throws:
java.lang.Exception
-
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 java.lang.Exception
- Throws:
java.lang.Exception
-
printEnrollmentTemplate
public static void printEnrollmentTemplate(CertEnrollmentRequest request)
-
-