POST Enrollment PFX
The POST /Enrollment Certificate enrollment refers to the process by which a user requests a digital certificate. The user must submit the request to a certificate authority (CA)./PFX
A PFX file (personal information exchange format), also known as a PKCS#12 archive, is a single, password-protected certificate archive that contains both the public and matching private key and, optionally, the certificate chain. It is a common format for Windows servers. method is used to enroll for a certificate by supplying data in the desired fields. This method returns HTTP 200 OK on a success with a message body containing a list of certificate details and any metadata
Metadata provides information about a piece of data. It is used to summarize basic information about data, which can make working with the data easier. In Keyfactor Command, the certificate metadata feature allows you to create custom metadata fields that allow you to tag certificates with tracking information about certificates. that was associated with the certificate request.
Global or container-level schedule permissions for certificate stores are needed to install a certificate generated with this method into a certificate store (see the x-Certificate Format parameter A parameter or argument is a value that is passed into a function in an application.) using the POST /Enrollment/PFX/Deploy method (see POST Enrollment PFX Deploy) or POST /Enrollment/PFX/Replace method (see POST Enrollment PFX Replace).


This method has two available versions. Keyfactor recommends using the newer method when possible. For more information about versioning, see Versioning.
Version 2 of the POST /Enrollment/PFX method redesigns how enrollment flow works to handle require approval functionality in a Keyfactor Command workflow with support for delivery into certificate stores. Users who are planning to use require approval workflow functionality and deliver enrolled certificates into certificate stores must use version 2 of this endpoint An endpoint is a URL that enables the API to gain access to resources on a server..
- System-wide enrollment pattern policy
- Individual enrollment pattern policy
- Supported algorithms set on the template
A certificate template defines the policies and rules that a CA uses when a request for a certificate is received. at the CA
A certificate authority (CA) is an entity that issues digital certificates. Within Keyfactor Command, a CA may be a Microsoft CA or a Keyfactor gateway to a cloud-based or remote CA. level
When configuring key information policies at the enrollment pattern level, only key sizes valid for the selected algorithm will be available. These are governed by the system-wide policy, enrollment pattern policy, and supported key sizes. For PFX enrollment and CSR generation, you must select a valid KeyType, and KeyLength or Curve as applicable, for the request.
Table 458: POST Enrollment PFX v2 Input Parameters
Name | In | Description |
---|---|---|
Additional Enrollment Fields | Body | An object that provide values for any custom enrollment fields set on the enrollment pattern for the certificate template to supply custom request attributes to the CA during the enrollment process. The additionalPropx is the user-defined field name and the string is the value for the field. For example: Copy
See Enrollment Pattern Operations for more information. |
Certificate Authority | Body |
Required*. A string that sets the name of the certificate authority that will be used to enroll against if there is more than one available with the provided template or enrollment pattern. The certificate authority name can either be provided in hostname\\logical name format or as just the logical name. For example: corpca01.keyexample.com\\CorpIssuingCA1 OR CorpIssuingCA1
If no certificate authority is provided, one will be chosen at random from the certificate authorities available for enrollment with the provided Template or EnrollmentPatternId. Note: The list of CAs from which a CA is selected if a template or enrollment pattern is not supplied depends on the enrollment pattern's Restrict CAs setting (see Basic Information Tab) and the configuration tenant of the template associated with the enrollment pattern:
In either case, the template associated with the enrollment pattern must also be available for enrollment on the CA and must have certificate request permissions granted to the appropriate user (see HTTPS CAs - Advanced Tab or DCOM CAs - Advanced Tab) in order for the CA to be included in the list. This field is optional unless the enrollment is being done against a standalone CA, in which case it is required. |
Chain Order | Body |
A string indicating the order in which the certificate chain should be returned if IncludeChain is set to true. Supported values are:
|
Curve | Body |
A string indicating the elliptic curve for the requested key. ECC curves must be specified using the OID for the ECC algorithm. Keyfactor recommends using one of the most commonly used ECC curves when possible, if a specific alternate curve is not required. Common curves include:
If this value is not supplied and the KeyType is ECC, the value will be derived from the KeyLength if the length provided matches one of the default curves (P-256, P-384, or P-521). |
Custom Friendly Name | Body |
Required*. A string that sets a custom friendly name for the certificate. This field is required if the Require Custom Friendly Name application setting is set to true (the default is false). See Application Settings: Enrollment Tab for more information. |
Enrollment Pattern Id | Body |
Required*. An integer indicating the enrollment pattern to use when requesting the certificate. If this value is not provided, the default enrollment pattern defined for the template provided in the request (see the Template parameter) will be used. One of either the Template or the EnrollmentPatternId is required unless the enrollment is being done against a standalone CA. If both the Template and EnrollmentPatternId are provided, the settings from the enrollment pattern take precedence. If both are specified, the enrollment will fail if the Template does not match the one defined by the specified enrollment pattern. |
Include Chain | Body |
A Boolean that sets whether to include the certificate chain in the response (true) or not (false). The default is true. Note: In order for chain certificates to be included with end entity certificates for download, one of the following must be true:
|
Include Subject Header | Body |
A Boolean that sets whether to include the subject header in the response (true) or not (false). The default is true if not included in the request. Only applicable when PEM format is selected. When set to false, the first line in the PEM file that contains the certificates subject information is removed. When set to true, the first line in the PEM file that contains the certificates subject information is included. Works with Include Chain option where it will remove the subject header, when set to false, for each of the certificates returned in the chain. It also works with Include Private Key option enabled.
|
Install Into Existing Certificate Stores | Body |
A Boolean that sets whether to deploy the certificate to certificate stores (true) or not (false). The default is true. The RenewalCertificateId parameter is used in conjunction with InstallIntoExistingCertificateStores parameter to make the determination as to distribution of the certificate to certificate stores. If InstallIntoExistingCertificateStores is true, the certificate will be distributed to certificate stores that the certificate identified in RenewalCertificateId is found in. |
JobTime | Body | A string containing the date and time when the certificate should be deployed. The date and time should be given using the ISO 8601 UTC time format YYYY-MM-DDTHH:mm:ss.000Z (e.g. 2023-11-19T16:23:01Z). Dates in the past are not allowed. To specify an Immediate enrollment, the JobTime should be omitted or left empty. Dates in the future will result in a management job set to run in the future. The default is to create a management job that runs immediately. |
Key Length | Body |
A string indicating the key size for the requested key. Supported key sizes are:
The default varies depending on the selected KeyType. For RSA, the default is 2048. |
KeyType | Body |
A string indicating the algorithm for the request. Supported values are:
|
Metadata | Body |
An object that set the values for the metadata fields that will be associated with the certificate once it is in Keyfactor Command. The additionalPropx is the field name and the string is the value for the field. For example: Copy
See Certificate Metadata for more information. |
Microsoft Target CSP | Body | A string indicating the optional cryptographic service provider (CSP) to associate with the certificate in the Public Key Cryptography Standard #12 (PKCS #12) key provider name attribute (OID 1.3.6.1.4.1.311.17.1). A value should only be provided here if the Allow Cryptographic Service Providers (CSPs) application setting has been enabled and only values included in the Cryptographic Service Providers (CSPs) application setting list are valid for this value (see Application Settings: Enrollment Tab). |
Owner Role Id | Body |
An integer indicating the Keyfactor Command reference ID of the security role assigned as the certificate owner. Note: To assign a certificate owner, one of OwnerRoleId or OwnerRoleName is required, not both. A certificate owner is required if the certificate template or system-wide settings Certificate Owner Role policy has been configured as Required.
|
Owner Role Name | Body |
A string containing the name of the security role assigned as the certificate owner. This name must match the existing name of the security role. Note: To assign a certificate owner, one of OwnerRoleId or OwnerRoleName is required, not both. A certificate owner is required if the certificate template or system-wide settings Certificate Owner Role policy has been configured as Required.
|
Password | Body |
A string that sets the password to be used to encrypt the PKCS12 blob. If this is not supplied, a random password will be generated. The minimum password length is controlled by the Password Length application setting. The default is 12. See Application Settings: Enrollment Tab for more information. |
Renewal Certificate Id | Body |
An integer that sets the ID of the certificate to be renewed when the method is called on a certificate renewal. The RenewalCertificateId parameter is used in conjunction with InstallIntoExistingCertificateStores parameter to make the determination as to distribution of the certificate to certificate stores. If InstallIntoExistingCertificateStores is true, the certificate will be distributed to certificate stores that the certificate identified in RenewalCertificateId is found in. |
SANs | Body |
An object that contains the
elements for Keyfactor Command to use when generating the subject alternative name (SAN) for the certificate requested by the CSR, each of which is supplied as an array of strings. For example: Copy
|
Stores | Body |
An array of objects indicating the certificate stores to which the certificate should be distributed. |
Subject | Body |
Required*. A string containing the subject name using X.500 format. For example: "Subject": "CN=websrvr14.keyexample.com,OU=IT,O=\"Key Example, Inc.\",L=Independence,ST=OH,C=US"
This field is required if the Common Name Regular Expression application setting is set to the default value of .+. See Application Settings: Enrollment Tab for more information. |
Template | Body |
Required*. A string that sets the name of the certificate template that should be used to issue the certificate. The template short name should be used. See also EnrollmentPatternId. One of either the Template or the EnrollmentPatternId is required unless the enrollment is being done against a standalone CA. If both the Template and EnrollmentPatternId are provided, the settings from the enrollment pattern take precedence. If both are specified, the enrollment will fail if the Template does not match the one defined by the specified enrollment pattern. Important: The template must be configured with at least one enrollment pattern in order to be used for enrollment (see POST Enrollment Patterns).
Note: This parameter is considered deprecated and may be removed in a future release.
|
Timestamp | Body | Required. A string indicating the current date and time. The date and time should be given using the ISO 8601 UTC time format YYYY-MM-DDTHH:mm:ss.000Z (e.g. 2023-11-19T16:23:01Z). |
Use Legacy Encryption | Body | A Boolean that sets whether legacy encryption should be used in generating the PKCS#12 file resulting from the enrollment request (true) or not (false). Legacy encryption algorithms include PBE-SHA1-RC2-40 and PBE-SHA1-3DES. When legacy is not selected, encryption algorithms include AES-256-CBC, PBES2 with PBKDF2, and PBE-SHA1-3DES. The default is false. |
x-Certificate Format | Header |
Required. A string containing the desired output format for the certificate. Available options are:
|
Table 459: POST Enrollment PFX v2 Response Data
Value | Description |
---|---|
Successful Stores | An array of strings containing a comma delimited list of certificate stores, referenced by certificate store GUID, to which the certificate was successfully scheduled for deployment. |
Certificate Information |
An object containing information about the certificate that was requested. |
Metadata |
An object containing the custom metadata values set on the certificate. The values vary depending on customization done in your environment. See Certificate Metadata for more information. |
Version 1 of the POST /Enrollment/PFX method includes the same capabilities as version 2 except when used in conjunction with Keyfactor Command workflows that require approval with an intended end goal of delivering the resulting certificate into a certificate store. In this specific case, version 2 must be used.
Table 460: POST Enrollment PFX v1 Input Parameters
Name | In | Description |
---|---|---|
Additional Enrollment Fields | Body | An object that provide values for any custom enrollment fields set on the enrollment pattern for the certificate template to supply custom request attributes to the CA during the enrollment process. The additionalPropx is the used-defined field name and the string is the value for the field. For example: Copy
See Enrollment Pattern Operations for more information. |
Certificate Authority | Body |
Required*. A string that sets the name of the certificate authority that will be used to enroll against if there is more than one available with the provided template name. The certificate authority name can either be provided in hostname\\logical name format or as just the logical name. For example: corpca01.keyexample.com\\CorpIssuingCA1 OR CorpIssuingCA1
If no certificate authority is provided, one will be chosen at random from the certificate authorities available for enrollment with the provided Template or EnrollmentPatternId. Note: The list of CAs from which a CA is selected if a template or enrollment pattern is not supplied depends on the enrollment pattern's Restrict CAs setting (see Basic Information Tab) and the configuration tenant of the template associated with the enrollment pattern:
In either case, the template associated with the enrollment pattern must also be available for enrollment on the CA and must have certificate request permissions granted to the appropriate user (see HTTPS CAs - Advanced Tab or DCOM CAs - Advanced Tab) in order for the CA to be included in the list. This field is optional unless the enrollment is being done against a standalone CA, in which case it is required. |
ChainOrder | Body |
A string indicating the order in which the certificate chain should be returned if IncludeChain is set to true. Supported values are:
|
Curve | Body |
A string indicating the elliptic curve for the requested key. ECC curves may be specified using the well-known OIDs for ECC algorithms. Well-known OIDs include:
|
Custom Friendly Name | Body |
Required*. A string that sets a custom friendly name for the certificate. This field is required if the Require Custom Friendly Name application setting is set to true (the default is false). See Application Settings: Enrollment Tab for more information. |
Enrollment Pattern Id | Body |
Required*. An integer indicating the enrollment pattern to use when requesting the certificate. If this value is not provided, the default enrollment pattern defined for the template provided in the request (see the Template parameter) will be used. One of either the Template or the EnrollmentPatternId is required unless the enrollment is being done against a standalone CA. If both the Template and EnrollmentPatternId are provided, the settings from the enrollment pattern take precedence. If both are specified, the enrollment will fail if the Template does not match the one defined by the specified enrollment pattern. |
Include Chain | Body |
A Boolean that sets whether to include the certificate chain in the response (true) or not (false). The default is true. |
Include Subject Header | Body |
A Boolean that sets whether to include the subject header in the response (true) or not (false). The default is true if not included in the request. Only applicable when PEM format is selected. When set to false, the first line in the PEM file that contains the certificates subject information is removed. When set to true, the first line in the PEM file that contains the certificates subject information is included. Works with Include Chain option where it will remove the subject header, when set to false, for each of the certificates returned in the chain. It also works with Include Private Key option enabled.
|
Key Length | Body |
A string indicating the key size for the requested key. |
KeyType | Body |
A string indicating the algorithm for the request. Supported values are:
|
Metadata | Body |
An object that set the values for the metadata fields that will be associated with the certificate once it is in Keyfactor Command. The additionalPropx is the field name and the string is the value for the field. For example: Copy
See Certificate Metadata for more information. |
Microsoft Target CSP | Body | A string indicating the optional cryptographic service provider (CSP) to associate with the certificate in the Public Key Cryptography Standard #12 (PKCS #12) key provider name attribute (OID 1.3.6.1.4.1.311.17.1). A value should only be provided here if the Allow Cryptographic Service Providers (CSPs) application setting has been enabled and only values included in the Cryptographic Service Providers (CSPs) application setting list are valid for this value (see Application Settings: Enrollment Tab). |
Owner Role Id | Body |
An integer indicating the Keyfactor Command reference ID of the security role assigned as the certificate owner. Note: To assign a certificate owner, one of OwnerRoleId or OwnerRoleName is required, not both. A certificate owner is required if the certificate template or system-wide settings Certificate Owner Role policy has been configured as Required.
|
Owner Role Name | Body |
A string containing the name of the security role assigned as the certificate owner. This name must match the existing name of the security role. Note: To assign a certificate owner, one of OwnerRoleId or OwnerRoleName is required, not both. A certificate owner is required if the certificate template or system-wide settings Certificate Owner Role policy has been configured as Required.
|
Password | Body |
A string that sets the password to be used to encrypt the PKCS12 blob. If this is not supplied, a random password will be generated. The minimum password length is controlled by the Password Length application setting. The default is 12. See Application Settings: Enrollment Tab for more information. |
Populate Missing Values From AD | Body |
A Boolean that sets whether to populate the information in the subject from Active Directory (true) or not (false). The default is false. |
Renewal Certificate Id | Body |
An integer that sets the ID of the certificate to be renewed when the method is called on a certificate renewal. |
SANs | Body |
An object that contains the
elements for Keyfactor Command to use when generating the subject alternative name (SAN) for the certificate requested by the CSR, each of which is supplied as an array of strings. For example: Copy
|
Subject | Body |
Required*. A string containing the subject name using X.500 format. For example: Copy
This field is required if the Common Name Regular Expression application setting is set to the default value of .+. See Application Settings: Enrollment Tab for more information. |
Template | Body |
Required*. A string that sets the name of the certificate template that should be used to issue the certificate. The template short name should be used. See also EnrollmentPatternId. One of either the Template or the EnrollmentPatternId is required unless the enrollment is being done against a standalone CA. If both the Template and EnrollmentPatternId are provided, the settings from the enrollment pattern take precedence. If both are specified, the enrollment will fail if the Template does not match the one defined by the specified enrollment pattern. Important: The template must be configured with at least one enrollment pattern in order to be used for enrollment (see POST Enrollment Patterns).
Note: This parameter is considered deprecated and may be removed in a future release.
|
Timestamp | Body | Required. A string indicating the current date and time. The date and time should be given using the ISO 8601 UTC time format YYYY-MM-DDTHH:mm:ss.000Z (e.g. 2023-11-19T16:23:01Z). |
Use Legacy Encryption | Body | A Boolean that sets whether legacy encryption should be used in generating the PKCS#12 file resulting from the enrollment request (true) or not (false). Legacy encryption algorithms include PBE-SHA1-RC2-40 and PBE-SHA1-3DES. When legacy is not selected, encryption algorithms include AES-256-CBC, PBES2 with PBKDF2, and PBE-SHA1-3DES. The default is false. |
x-Certificate Format | Header |
Required. A string containing the desired output format for the certificate. Available options are:
|
Table 461: POST Enrollment PFX v1 Response Data
Value | Description |
---|---|
Certificate Information |
An object containing information about the certificate that was requested. |
Metadata |
An object containing the custom metadata values set on the certificate. The values vary depending on customization done in your environment. See Certificate Metadata for more information. |


Was this page helpful? Provide Feedback