Select this subject builder to replace DN (Distinguished Name) variables in a template with variables from the CSR (Certificate Signing Request).

Example: building the Common Name from Subject Variables

To build the final DN, the following template expects an enrollment request with subject variables for "First Name" and "Last Name".

- name: "Use TemplateSubjectBuilder"
unique-id: "CA-1003-PROF-1002"
subject-variable-requirements:
- name: First Name
description: "First Name"
required: true
- name: Last Name
description: "Last Name"
required: true
subject-builder-config:
subject-builder-name: "com.entrust.adminservices.cagw.common.subjects.TemplateSubjectBuilder"
properties:
template: "cn=<First Name> <Last Name>, ou=CA01,o=pki,dc=test,dc=com"

For example, when receiving the following request values.

"subjectVariables" : [
{
"type" : "First Name",
"value" : "PKI"
},
{
"type" : "Last Name",
"value" : "Test"
}
]

The template builds the following Distinguished Name.

cn=PKI Test,ou=CA01,o=pki,dc=test,dc=com

Example: building the Common Name when no Subject Variables are provided

To build the final DN when no Subject Variables are provided, the following template parses the CSR for common name. 

This configuration will not process fields other than CN and UID.

- name: "Use TemplateSubjectBuilder"
unique-id: "CA-1003-PROF-1002"
subject-builder-config:
subject-builder-name: "com.entrust.adminservices.cagw.common.subjects.TemplateSubjectBuilder"
properties:
template: "cn=<cn>,ou=CA01,o=pki,dc=test,dc=com"

Parsing a CSR with multiple common names requires indexing the template output, starting with cn.1.  For example;

template: "cn=<cn.1>, cn=<cn.2>, cn=<cn.3>, ou=CA01,o=pki,dc=test,dc=com"

The use of <CN> or <cn> should be consistent.