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..
When configuring template-level policies for key information, only key sizes that are valid for the algorithm will be available, according to the system-wide policy, the template-level policy, and the 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 427: 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 certificate template to supply custom request attributes to the CA during the enrollment process. For example: Copy
See Certificate Template 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. 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 EndEntityFirst or RootFirst. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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:
Show named curves and associated OIDs.
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). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. For example: Copy
See Certificate Metadata for more information. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Password | Body |
Required. A string that sets the password used to encrypt the contents of the PFX file. 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. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Stores | Body |
An array of objects indicating the certificate stores to which the certificate should be distributed. Show store details. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. This field is required unless the enrollment is being done against a standalone CA. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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. Show SAN key values. For example: Copy
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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 428: 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. Show certificate information details. |
Metadata |
An object containing the custom metadata values set on the certificate. The values vary depending on customization done in your environment. Show metadata structure details. 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 429: POST Enrollment PFX v1 Input Parameters
Name | In | Description |
---|---|---|
Additional Enrollment Fields | Body | An object that provides values for any custom enrollment fields set on the certificate template to supply custom request attributes to the CA during the enrollment process. For example: “AdditionalEnrollmentFields”: { “CustomStringOne”: "MyValue", “CustomMultiChoiceOne”: "ValueTwo" } See Certificate Template 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. 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 EndEntityFirst or RootFirst. |
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. |
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:
|
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). |
Include Chain | Body |
A Boolean that sets whether to include the certificate chain in the response (true) or not (false). The default is true. |
Key Length | Body |
A string indicating the key size for the requested key. |
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.
|
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 key is the field name and the value is the value for the field. For example: Copy
See Certificate Metadata for more information. |
Password | Body |
Required. A string that sets the password used to encrypt the contents of the PFX file. 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. Show SAN key values. 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. This field is required unless the enrollment is being done against a standalone CA. |
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.
|
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 430: POST Enrollment PFX v1 Response Data
Value | Description |
---|---|
Certificate Information |
An object containing information about the certificate that was requested. Show certificate information details. |
Metadata |
An object containing the custom metadata values set on the certificate. The values vary depending on customization done in your environment. Show metadata structure details. See Certificate Metadata for more information. |