Package com.netscape.cmstools.profile
Class ProfileCLI
- java.lang.Object
-
- org.dogtagpki.cli.CLI
-
- com.netscape.cmstools.profile.ProfileCLI
-
public class ProfileCLI extends org.dogtagpki.cli.CLI
-
-
Field Summary
Fields Modifier and Type Field Description CACLI
caCLI
static org.slf4j.Logger
logger
com.netscape.certsrv.profile.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()
com.netscape.certsrv.profile.ProfileClient
getProfileClient()
static void
printEnrollmentTemplate(com.netscape.certsrv.cert.CertEnrollmentRequest request)
static void
printProfile(com.netscape.certsrv.profile.ProfileData data, java.net.URI baseUri)
static void
printProfileDataInfo(com.netscape.certsrv.profile.ProfileDataInfo info)
static com.netscape.certsrv.profile.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, com.netscape.certsrv.cert.CertEnrollmentRequest request)
static void
saveProfileToFile(java.lang.String filename, com.netscape.certsrv.profile.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 com.netscape.certsrv.profile.ProfileClient profileClient
-
-
Constructor Detail
-
ProfileCLI
public ProfileCLI(CACLI caCLI)
-
-
Method Detail
-
getFullName
public java.lang.String getFullName()
- Overrides:
getFullName
in classorg.dogtagpki.cli.CLI
-
getManPage
public java.lang.String getManPage()
- Overrides:
getManPage
in classorg.dogtagpki.cli.CLI
-
getProfileClient
public com.netscape.certsrv.profile.ProfileClient getProfileClient() throws java.lang.Exception
- Throws:
java.lang.Exception
-
printProfileDataInfo
public static void printProfileDataInfo(com.netscape.certsrv.profile.ProfileDataInfo info)
-
printProfile
public static void printProfile(com.netscape.certsrv.profile.ProfileData data, java.net.URI baseUri)
-
saveProfileToFile
public static void saveProfileToFile(java.lang.String filename, com.netscape.certsrv.profile.ProfileData data) throws javax.xml.bind.JAXBException, java.io.FileNotFoundException
- Throws:
javax.xml.bind.JAXBException
java.io.FileNotFoundException
-
readProfileFromFile
public static com.netscape.certsrv.profile.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, com.netscape.certsrv.cert.CertEnrollmentRequest request) throws javax.xml.bind.JAXBException, java.io.FileNotFoundException
- Throws:
javax.xml.bind.JAXBException
java.io.FileNotFoundException
-
printEnrollmentTemplate
public static void printEnrollmentTemplate(com.netscape.certsrv.cert.CertEnrollmentRequest request)
-
-