Skip to content

Commit aceca2d

Browse files
authored
Merge pull request #32 from Keyfactor/dev-2.1
Dev 2.1
2 parents b2bc4a3 + db730d5 commit aceca2d

7 files changed

Lines changed: 46 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,10 @@
99
* Add support for enrolling for client certs
1010
* Option to filter sync by division ID
1111
* Option to provide division ID for enrollment
12-
* Add support for secure_email_* SMIME product types
12+
* Add support for secure_email_* SMIME product types
13+
14+
### 2.1.1
15+
* Add configuration flag to support adding client auth EKU to ssl cert requests
16+
* NOTE: This is a temporary feature which is planned for loss of support by Digicert in May 2026
17+
* For smime certs, use profile type defined on the product as the default if not supplied, rather than just defaulting to 'strict'
18+
* Hotfix for data type conversion

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,10 @@ An API Key within your Digicert account that has the necessary permissions to en
106106
* **Organization-Name** - OPTIONAL: For requests that will not have a subject (such as ACME) you can use this field to provide the organization name. Value supplied here will override any CSR values, so do not include this field if you want the organization from the CSR to be used.
107107
* **RenewalWindowDays** - OPTIONAL: The number of days from certificate expiration that the gateway should do a renewal rather than a reissue. If not provided, default is 90.
108108
* **CertType** - OPTIONAL: The type of cert to enroll for. Valid values are 'ssl' and 'client'. The value provided here must be consistant with the ProductID. If not provided, default is 'ssl'. Ignored for secure_email_* product types.
109+
* **IncludeClientAuthEKU** - OPTIONAL for SSL certs, ignored otherwise. If set to 'true', SSL certs enrolled under this template will have the Client Authentication EKU added to the request. NOTE: This feature is currently planned to be removed by DigiCert in May 2026.
109110
* **EnrollDivisionId** - OPTIONAL: The division (container) ID to use for enrollments against this template.
110111
* **CommonNameIndicator** - Required for secure_email_sponsor and secure_email_organization products, ignored otherwise. Defines the source of the common name. Valid values are: email_address, given_name_surname, pseudonym, organization_name
111-
* **ProfileType** - Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Default value is strict.
112+
* **ProfileType** - Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Use 'multipurpose' if your cert includes any additional EKUs such as client auth. Default if not provided is dependent on product configuration within Digicert portal.
112113
* **FirstName** - Required for secure_email_* types if CommonNameIndicator is given_name_surname, ignored otherwise.
113114
* **LastName** - Required for secure_email_* types if CommonNameIndicator is given_name_surname, ignored otherwise.
114115
* **Pseudonym** - Required for secure_email_* types if CommonNameIndicator is pseudonym, ignored otherwise.

digicert-certcentral-caplugin/API/OrderCertificate.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ public class CertificateRequest
101101

102102
[JsonProperty("ca_cert_id")]
103103
public string CACertID { get; set; }
104+
105+
[JsonProperty("profile_option")]
106+
public string ProfileOption { get; set; }
104107
}
105108

106109
public class CertificateOrderContainer

digicert-certcentral-caplugin/CertCentralCAPlugin.cs

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,12 @@ public async Task<EnrollmentResult> Enroll(string csr, string subject, Dictionar
294294
string priorCertSnString = null;
295295
string priorCertReqID = null;
296296

297+
if (typeOfCert.Equals("ssl") && Convert.ToBoolean(productInfo.ProductParameters[CertCentralConstants.Config.INCLUDE_CLIENT_AUTH]))
298+
{
299+
orderRequest.Certificate.ProfileOption = "server_client_auth_eku";
300+
_logger.LogWarning($"{CertCentralConstants.Config.INCLUDE_CLIENT_AUTH}: Ability to include client auth EKU in SSL certs is currently planned to cease in May 2026. Make sure any workflows that depend on this feature are updated before then to avoid interruptions.");
301+
}
302+
297303
// Current gateway core leaves it up to the integration to determine if it is a renewal or a reissue
298304
if (enrollmentType == EnrollmentType.RenewOrReissue)
299305
{
@@ -584,6 +590,13 @@ public Dictionary<string, PropertyConfigInfo> GetTemplateParameterAnnotations()
584590
DefaultValue = "ssl",
585591
Type = "String"
586592
},
593+
[CertCentralConstants.Config.INCLUDE_CLIENT_AUTH] = new PropertyConfigInfo()
594+
{
595+
Comments = "OPTIONAL for SSL certs, ignored otherwise. If set to 'true', SSL certs enrolled under this template will have the Client Authentication EKU added to the request. NOTE: This feature is currently planned to be removed by DigiCert in May 2026.",
596+
Hidden = false,
597+
DefaultValue = false,
598+
Type = "Boolean"
599+
},
587600
[CertCentralConstants.Config.ENROLL_DIVISION_ID] = new PropertyConfigInfo()
588601
{
589602
Comments = "OPTIONAL: The division (container) ID to use for enrollments against this template.",
@@ -600,7 +613,7 @@ public Dictionary<string, PropertyConfigInfo> GetTemplateParameterAnnotations()
600613
},
601614
[CertCentralConstants.Config.PROFILE_TYPE] = new PropertyConfigInfo()
602615
{
603-
Comments = "Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Default value is strict.",
616+
Comments = "Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Use 'multipurpose' if your cert includes any additional EKUs such as client auth. Default if not provided is dependent on product configuration within Digicert portal.",
604617
Hidden = false,
605618
DefaultValue = "strict",
606619
Type = "String"
@@ -1023,7 +1036,7 @@ public async Task ValidateProductInfo(EnrollmentProductInfo productInfo, Diction
10231036
detailsRequest.ContainerId = null;
10241037
if (connectionInfo.ContainsKey(CertCentralConstants.Config.DIVISION_ID))
10251038
{
1026-
string div = (string)connectionInfo[CertCentralConstants.Config.DIVISION_ID];
1039+
string div = connectionInfo[CertCentralConstants.Config.DIVISION_ID].ToString();
10271040
if (!string.IsNullOrWhiteSpace(div))
10281041
{
10291042
if (int.TryParse($"{div}", out int divId))
@@ -1680,9 +1693,10 @@ private EnrollmentResult EnrollForSmimeCert(string csr, string subject, Dictiona
16801693
}
16811694
}
16821695

1696+
string profile = null;
16831697
if (productInfo.ProductParameters.ContainsKey(CertCentralConstants.Config.PROFILE_TYPE))
16841698
{
1685-
string profile = productInfo.ProductParameters[CertCentralConstants.Config.PROFILE_TYPE].ToString();
1699+
profile = productInfo.ProductParameters[CertCentralConstants.Config.PROFILE_TYPE].ToString();
16861700

16871701
// Only validate if value provided
16881702
if (!string.IsNullOrEmpty(profile))
@@ -1693,6 +1707,10 @@ private EnrollmentResult EnrollForSmimeCert(string csr, string subject, Dictiona
16931707
throw new Exception($"Invalid profile type provided. Valid values are: strict, multipurpose");
16941708
}
16951709
}
1710+
else
1711+
{
1712+
profile = null;
1713+
}
16961714
}
16971715

16981716
if (cnIndic.Equals("given_name_surname", StringComparison.OrdinalIgnoreCase))
@@ -1884,12 +1902,11 @@ private EnrollmentResult EnrollForSmimeCert(string csr, string subject, Dictiona
18841902
orderRequest.Certificate.SignatureHash = certType.signatureAlgorithm;
18851903
orderRequest.Certificate.CACertID = caCertId;
18861904
orderRequest.SetOrganization(organizationId);
1887-
string profileType = "strict";
1888-
if (productInfo.ProductParameters.ContainsKey(Constants.Config.PROFILE_TYPE))
1905+
//If profile type is not provided, use the default on the digicert product configuration
1906+
if (!string.IsNullOrEmpty(profile))
18891907
{
1890-
profileType = productInfo.ProductParameters[Constants.Config.PROFILE_TYPE];
1891-
}
1892-
orderRequest.Certificate.ProfileType = profileType;
1908+
orderRequest.Certificate.ProfileType = profile;
1909+
}
18931910
orderRequest.Certificate.CommonNameIndicator = cnIndicator;
18941911
if (productInfo.ProductID.Equals("secure_email_sponsor", StringComparison.OrdinalIgnoreCase))
18951912
{

digicert-certcentral-caplugin/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public class Config
3232
public const string FILTER_EXPIRED = "FilterExpiredOrders";
3333
public const string SYNC_EXPIRATION_DAYS = "SyncExpirationDays";
3434
public const string CERT_TYPE = "CertType";
35+
public const string INCLUDE_CLIENT_AUTH = "IncludeClientAuthEKU";
3536
public const string ENROLL_DIVISION_ID = "EnrollDivisionId";
3637
public const string COMMON_NAME_INDICATOR = "CommonNameIndicator";
3738
public const string PROFILE_TYPE = "ProfileType";

digicert-certcentral-caplugin/digicert-certcentral-caplugin.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
55
<RootNamespace>Keyfactor.Extensions.CAPlugin.DigiCert</RootNamespace>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>disable</Nullable>
88
<AssemblyName>DigicertCAPlugin</AssemblyName>
9+
<AssemblyVersion>2.1.1</AssemblyVersion>
10+
<FileVersion>2.1.1</FileVersion>
911
</PropertyGroup>
1012

1113
<ItemGroup>

integration-manifest.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@
7272
"name": "CertType",
7373
"description": "OPTIONAL: The type of cert to enroll for. Valid values are 'ssl' and 'client'. The value provided here must be consistant with the ProductID. If not provided, default is 'ssl'. Ignored for secure_email_* product types."
7474
},
75+
{
76+
"name": "IncludeClientAuthEKU",
77+
"description": "OPTIONAL for SSL certs, ignored otherwise. If set to 'true', SSL certs enrolled under this template will have the Client Authentication EKU added to the request. NOTE: This feature is currently planned to be removed by DigiCert in May 2026."
78+
},
7579
{
7680
"name": "EnrollDivisionId",
7781
"description": "OPTIONAL: The division (container) ID to use for enrollments against this template."
@@ -82,7 +86,7 @@
8286
},
8387
{
8488
"name": "ProfileType",
85-
"description": "Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Default value is strict."
89+
"description": "Optional for secure_email_* types, ignored otherwise. Valid values are: strict, multipurpose. Use 'multipurpose' if your cert includes any additional EKUs such as client auth. Default if not provided is dependent on product configuration within Digicert portal."
8690
},
8791
{
8892
"name": "FirstName",

0 commit comments

Comments
 (0)