Use of undefined Relative Distinguished Names (RDN) in issued certificates

Sometimes it is necessary to allow Relative Distinguished Names (RDNs) in issued certificates that are not defined and therefore could not be configured in the SubjectTemplate value in the certification authority's registry either.

An example of this is the Organization Identifier with object identifier 2.5.4.97, which is required, for example, for certificates that comply with the eIDAS Regulation.

Configuration steps for root certification authority certificates

No special configuration steps are required for certificates from root certification authorities. Since their attributes are defined during the installation of the certification authority role, they can simply be passed with the -CADistinguishedNameSuffix parameter (for an installation via the graphical user interface, there is a corresponding input field).

Install-AdcsCertificationAuthority `
-CAType "StandaloneRootCA" `
-KeyLength 4096 `
-HashAlgorithm SHA256 `
-CryptoProviderName "RSA#Microsoft Software Key Storage Provider" `
-CACommonName "ADCS Labor Test Root CA 1" `
-CADistinguishedNameSuffix "O=ADCS Labor,L=Munich,S=Bavaria,C=DE,2.5.4.97=12345678" `
-ValidityPeriod Years `
-ValidityPeriodUnits 16 `
-OverwriteExistingDatabase `
-OverwriteExistingKey `
-Force

PowerShell: Install-AdcsCertificationAuthority with -CADistinguishedNameSuffix containing OID 2.5.4.97=12345678 (marked in red)

Certificate dialog, "Details" tab: subject with CN, O, L, S, C and the undefined RDN 2.5.4.97 = 12345678 marked in yellow

Configuration steps for all other types of certificates

Do you know TameMyCerts? TameMyCerts is an add-on for the Microsoft certification authority (Active Directory Certificate Services). It extends the function of the certification authority and enables the application of rule sets to realize the secure automation of certificate issuance. TameMyCerts is unique in the Microsoft ecosystem, has already proven itself in countless companies around the world and is available under a free license. It can be downloaded via GitHub and used free of charge. Professional maintenance is also offered.

This concerns the behavior of certification authorities when issuing certificates and thus all types of certification authorities:

  • Root certification authorities
  • Intermediate certification authorities
  • Issuing certification authorities

To prevent certification authorities from rebuilding the subject based on the rules defined in the "SubjectTemplate" registry value when issuing the certificate, the following command can be run:

certutil -setreg CA\CRLFlags +CRLF_REBUILD_MODIFIED_SUBJECT_ONLY

Command prompt: certutil -setreg CA\CRLFlags +CRLF_REBUILD_MODIFIED_SUBJECT_ONLY sets CRLFlags to 22 (34)

The certification authority service must then be restarted for the changes to be applied.

If this setting is active, the certification authority no longer checks the syntax and conformity with the relevant RFCs. In any case, the certificate request must be checked manually by a certificate manager. Since the setting applies globally to the certification authority, a dedicated issuing certification authority should be used for these requests to avoid interactions.

The settings for character encoding within RDNs (ForceTeletex) are also overridden by setting this flag, i.e. the subject DN is taken over 1:1 from the certificate request, also with regard to the character encoding.

Requesting certificates

The setting has an effect only if the certificate template is configured to allow the enrollee to specify the subject in the certificate request.

Template properties "Properties of New Template", "Subject Name" tab: "Supply in the request" marked in yellow

Further information

External sources