From 0054cfb7ebd41fb39a92d71e623cf2cbf8365de3 Mon Sep 17 00:00:00 2001 From: Fraser Tweedale Date: Oct 05 2017 10:57:10 +0000 Subject: ipa-ca-install: add --external-ca-profile option Fixes: https://pagure.io/freeipa/issue/6858 Reviewed-By: Florence Blanc-Renaud --- diff --git a/install/tools/ipa-ca-install b/install/tools/ipa-ca-install index 4579492..3bdd763 100755 --- a/install/tools/ipa-ca-install +++ b/install/tools/ipa-ca-install @@ -69,6 +69,11 @@ def parse_options(): type="choice", choices=ext_cas, metavar="{{{0}}}".format(",".join(ext_cas)), help="Type of the external CA. Default: generic") + parser.add_option("--external-ca-profile", dest="external_ca_profile", + type='constructor', constructor=cainstance.ExternalCAProfile, + default=None, metavar="PROFILE-SPEC", + help="Specify the certificate profile/template to use " + "at the external CA") parser.add_option("--external-cert-file", dest="external_cert_files", action="append", metavar="FILE", help="File containing the IPA CA certificate and the external CA certificate chain") @@ -116,6 +121,11 @@ def parse_options(): parser.error( "You cannot specify --external-ca-type without --external-ca") + if options.external_ca_profile and not options.external_ca: + parser.error( + "You cannot specify --external-ca-profile " + "without --external-ca") + return safe_options, options, filename diff --git a/install/tools/man/ipa-ca-install.1 b/install/tools/man/ipa-ca-install.1 index 79703a4..99ff918 100644 --- a/install/tools/man/ipa-ca-install.1 +++ b/install/tools/man/ipa-ca-install.1 @@ -48,7 +48,26 @@ Admin user Kerberos password used for connection check Generate a CSR for the IPA CA certificate to be signed by an external CA. .TP \fB\-\-external\-ca\-type\fR=\fITYPE\fR -Type of the external CA. Possible values are "generic", "ms-cs". Default value is "generic". Use "ms-cs" to include template name required by Microsoft Certificate Services (MS CS) in the generated CSR. +Type of the external CA. Possible values are "generic", "ms-cs". Default value is "generic". Use "ms-cs" to include the template name required by Microsoft Certificate Services (MS CS) in the generated CSR (see \fB\-\-external\-ca\-profile\fR for full details). + +.TP +\fB\-\-external\-ca\-profile\fR=\fIPROFILE_SPEC\fR +Specify the certificate profile or template to use at the external CA. + +When \fB\-\-external\-ca\-type\fR is "ms-cs" the following specifiers may be used: + +.RS +.TP +\fB:[:]\fR +Specify a certificate template by OID and major version, optionally also specifying minor version. +.TP +\fB\fR +Specify a certificate template by name. The name cannot contain any \fI:\fR characters and cannot be an OID (otherwise the OID-based template specifier syntax takes precedence). +.TP +\fBdefault\fR +If no template is specified, the template name "SubCA" is used. +.RE + .TP \fB\-\-external\-cert\-file\fR=\fIFILE\fR File containing the IPA CA certificate and the external CA certificate chain. The file is accepted in PEM and DER certificate and PKCS#7 certificate chain formats. This option may be used multiple times.