Chapter 5. Requesting, enrolling and managing certificates
Certificates are requested and used by end users. Although certificate enrollment and renewal are operations that are not limited to administrators, understanding the enrollment and renewal processes can make it easier for administrators to manage and create appropriate certificate profiles, as described in Section 3.2, “Setting up certificate profiles”, and to use fitting authentication methods (described in Chapter 8, Authentication for enrolling certificates) for each certificate type.
This chapter discusses requesting, receiving, and renewing certificates for use outside Certificate System. For information on requesting and renewing Certificate System subsystem certificates, see Chapter 13, Managing subsystem certificates.
5.1. About enrolling and renewing certificates Copy linkLink copied to clipboard!
Enrollment is the process for requesting and receiving a certificate. The mechanics for the enrollment process are slightly different depending on the type of certificate, the method for generating its key pair, and the method for generating and approving the certificate itself. Whatever the specific method, certificate enrollment, at a high level, has the same basic steps:
- A certificate request (CSR) is generated.
- The certificate request is submitted to the CA.
- The request is verified by authenticating the entity which requested it and by confirming that the request meets the certificate profile rules which were used to submit it.
- The request is approved.
- The requesting party retrieves the new certificate.
When the certificate reaches the end of its validity period, it can be renewed.
5.2. Creating certificate signing requests (CSR) Copy linkLink copied to clipboard!
As explained in 2.4.1.1.2.2 Enrolling with CMC section in the Planning, Installation and Deployment Guide (Common Criteria Edition), the CMCRequest utility accepts Certificate Signing Requests (CSR) in PKCS #10 and CRMF format.
Red Hat Certificate System supports using the following utilities to create CSRs:
-
certutil: Supports creating PKCS #10 requests. -
PKCS10Client: Supports creating PKCS #10 requests. -
CRMFPopClient: Supports creating CRMF requests.
The following sections provide some examples on how to use these utilities with the feature-rich enrollment profile framework.
Although server-side key generation appears to be provided on the browser EE portal, to allow for key generation on the CS server (where keys are then transferred securely back to the client) in order to overcome the inconvenience caused by the removal of keygen support by the latest browsers, this feature is not evaluated in the Common Criteria release.
5.2.1. Creating a CSR using certutil Copy linkLink copied to clipboard!
This section describes examples on how to use the certutil utility to create a CSR.
For further details about using certutil, see:
-
The
certutil(1)man page -
The output of the
certutil --helpcommand
5.2.1.1. Using certutil to create a CSR with EC keys Copy linkLink copied to clipboard!
The following procedure demonstrates how to use the certutil utility to create an Elliptic Curve (EC) key pair and CSR:
Change to the certificate database directory of the user or entity for which the certificate is being requested, for example:
$ cd /user_or_entity_database_directory/Create the binary CSR and store it in the
request.csrfile:$ certutil -d . -R -k ec -q nistp256 -s "CN=subject_name" -o request-bin.csrEnter the required NSS database password when prompted.
For further details about the parameters, see the
certutil(1)man page.Convert the created binary format CSR to PEM format:
$ BtoA request-bin.csr request.csrOptionally, verify that the CSR file is correct:
$ cat request.csr MIICbTCCAVUCAQAwKDEQMA4GA1UEChMHRXhhbXBsZTEUMBIGA1UEAxMLZXhhbXBs ...This is a PKCS#10 PEM certificate request.
- For the next steps, see Section 5.3.1, “The CMC enrollment process”, but skip the step about creating the certificate request.
5.2.1.2. Using certutil to create a CSR with user-defined extensions Copy linkLink copied to clipboard!
The following procedure demonstrates how to create a CSR with user-defined extensions using the certutil utility.
Note that the enrollment requests are constrained by the enrollment profiles defined by the CA. See Example B.3, “Multiple user supplied extensions in CSR”.
Change to the certificate database directory of the user or entity for which the certificate is being requested, for example:
$ cd /user_or_entity_database_directory/Create the CSR with user-defined Key Usage extension as well as user-defined Extended Key Usage extension and store it in the
request.csrfile:$ certutil -d . -R -k rsa -g 1024 -s "CN=subject_name" --keyUsage keyEncipherment,dataEncipherment,critical --extKeyUsage timeStamp,msTrustListSign,critical -a -o request.csrEnter the required NSS database password when prompted.
For further details about the parameters, see the
certutil(1)man page.Optionally, verify that the CSR file is correct:
$ cat request.csr Certificate request generated by Netscape certutil Phone: (not specified) Common Name: user 4-2-1-2 Email: (not specified) Organization: (not specified) State: (not specified) Country: (not specified)This is a PKCS#10 PEM certificate request.
NoteSince the above certutil command contained the
-aoption for a text format CSR, be sure to remove header information before proceeding. If you omit-a, be sure to use theBtoAtool to convert from binary to text format, as seen above in section Section 5.2.1.1, “Usingcertutilto create a CSR with EC keys”. Since the above certutil command contained -a option for a text format CSR, be sure to remove header information before proceeding. If -a is omitted, be sure to use BtoA to convert from binary to text format, as seen above in section "5.2.1.1. Using certutil to create a CSR with EC keys".
For the next steps, see Section 5.3.1, “The CMC enrollment process”, but skip the step about creating the certificate request.
5.2.2. Creating a CSR using PKCS10Client Copy linkLink copied to clipboard!
This section provides examples on how to use the PKCS10Client utility to create a CSR.
For further details about using PKCS10Client, see:
-
The
PKCS10Client(1)man page -
The output of the
PKCS10Client --helpcommand
5.2.2.1. Using PKCS10Client to create a CSR Copy linkLink copied to clipboard!
The following procedure explains how to use the PKCS10Client utility to create an Elliptic Curve (EC) key pair and CSR:
Change to the certificate database directory of the user or entity for which the certificate is being requested, for example:
$ cd /user_or_entity_database_directory/Create the CSR and store it in the
example.csrfile:$ PKCS10Client -d . -p NSS_password -a ec -c nistp256 -o example.csr -n "CN=subject_name"For further details about the parameters, see the
PKCS10Client(1)man page.Optionally, verify that the CSR is correct:
$ cat example.csr -----BEGIN CERTIFICATE REQUEST----- MIICzzCCAbcCAQAwgYkx ... -----END CERTIFICATE REQUEST-----
For the next steps, see Section 5.3.1, “The CMC enrollment process”.
5.2.2.2. Using PKCS10Client to create a CSR for SharedSecret-based CMC Copy linkLink copied to clipboard!
The following procedure explains how to use the PKCS10Client utility to create an RSA key pair and CSR for SharedSecret-based CMC. Use it only with the CMC Shared Secret authentication method which is, by default, handled by the caFullCMCSharedTokenCert and caECFullCMCSharedTokenCert profiles.
Change to the certificate database directory of the user or entity for which the certificate is being requested, for example:
$ cd /user_or_entity_database_directory/Create the CSR and store it in the
example.csrfile:$ PKCS10Client -d . -p NSS_password -o example.csr -y true -n "CN=subject_name"The keypair private key ID generated in the output is saved to a file with the name format
<CSR output file name>.keyId. This ID will be used later on when following the Shared Secret or Decrypted POP CMC enrollment procedure.For further details about the parameters, see the
PKCS10Client(1)man page.Optionally, verify that the CSR is correct:
$ cat example.csr -----BEGIN CERTIFICATE REQUEST----- MIICzzCCAbcCAQAwgYkx ... -----END CERTIFICATE REQUEST-----
For the next steps, skip to Section 5.3.2.2.2, “Authenticating for certificate enrollment using a shared secret”.
5.2.3. Creating a CSR using CRMFPopClient Copy linkLink copied to clipboard!
Certificate Request Message Format (CRMF) is a CSR format accepted in CMC that allows key archival information to be securely embedded in the request.
This section provides examples on how to use the CRMFPopClient utility to create a CSR.
For further details about using CRMFPopClient, run the CRMFPopClient –help command.
5.2.3.1. Using CRMFPopClient to create a CSR with key archival Copy linkLink copied to clipboard!
The following procedure explains how to use the CRMFPopClient utility to create an RSA key pair and a CSR with the key archival option:
Change to the certificate database directory of the user or entity for which the certificate is being requested, for example:
$ cd /user_or_entity_database_directory/Retrieve the KRA transport certificate from the CA:
$ pki -p 8443 ca-cert-find --name "DRM Transport Certificate" --------------- 1 entries found --------------- Serial Number: 0x7 Subject DN: CN=DRM Transport Certificate,O=EXAMPLE Status: VALID Type: X.509 version 3 Key Algorithm: PKCS #1 RSA with 2048-bit key Not Valid Before: Thu Oct 22 18:26:11 CEST 2015 Not Valid After: Wed Oct 11 18:26:11 CEST 2017 Issued On: Thu Oct 22 18:26:11 CEST 2015 Issued By: caadmin ---------------------------- Number of entries returned 1Export the KRA transport certificate:
$ pki -p 8443 ca-cert-show 0x7 --output kra.transportCreate the CSR and store it in the
example.csrfile:$ CRMFPopClient -d . -p password -n "cn=subject_name" -q POP_SUCCESS -b kra.transport -w "AES KeyWrap/Wrapped" -v -o example.csr -oaep Initializing security database: . archival option enabled Loading transport certificate Parsing subject DN RDN: CN=subject_name Generating key pair: temporary: false CryptoUtil: generateRSAKeyPair: calling kg.setKeyPairUsages Keypair private key id: 27a7e30b48f268ddcc8681633d4014579416d6ca Using key wrap algorithm: AES KeyWrap/Wrapped Creating certificate request CRMFPopClient: use_shared_secret true. Generating SubjectKeyIdentifier extension. Creating signer Creating POP Creating CRMF request Storing CRMF request into example.csr Storing CRMF request key id into example.csr.keyIdNoteTo create an Elliptic Curve (EC) key pair and CSR, pass the -a ec -t false options to the command. For further details about the parameters, see the
CRMFPopClient –helpcmmand.Optionally, verify that the CSR is correct:
$ cat example.csr -----BEGIN CERTIFICATE REQUEST----- MIICzzCCAbcCAQAwgYkx ... -----END CERTIFICATE REQUEST-----
For the next steps, see Section 5.3.1, “The CMC enrollment process”.
5.2.3.2. Using CRMFPopClient to create a CSR for SharedSecret-based CMC Copy linkLink copied to clipboard!
The following procedure explains how to use the CRMFPopClient utility to create an RSA key pair and CSR for SharedSecret-based CMC. Use it only with the CMC Shared Secret authentication method which is, by default, handled by the caFullCMCSharedTokenCert and caECFullCMCSharedTokenCert profiles.
Change to the certificate database directory of the user or entity for which the certificate is being requested, for example:
$ cd /user_or_entity_database_directory/Retrieve the KRA transport certificate:
$ pki -p 8443 ca-cert-find --name "DRM Transport Certificate" --------------- 1 entries found --------------- Serial Number: 0x7 Subject DN: CN=DRM Transport Certificate,O=EXAMPLE Status: VALID Type: X.509 version 3 Key Algorithm: PKCS #1 RSA with 2048-bit key Not Valid Before: Thu Oct 22 18:26:11 CEST 2015 Not Valid After: Wed Oct 11 18:26:11 CEST 2017 Issued On: Thu Oct 22 18:26:11 CEST 2015 Issued By: caadmin ---------------------------- Number of entries returned 1Export the KRA transport certificate:
$ pki -p 8443 ca-cert-export 0xc --output-file kra.transportCreate the CSR and store it in the
example.csrfile:$ CRMFPopClient -d . -p password -n "cn=subject_name" -q POP_SUCCESS -b kra.transport -w "AES KeyWrap/Wrapped" -y -v -o example.csr -oaep Initializing security database: . archival option enabled Loading transport certificate Parsing subject DN RDN: CN=subject_name Generating key pair: temporary: false CryptoUtil: generateRSAKeyPair: calling kg.setKeyPairUsages Keypair private key id: 6e786393637781a4ae281f5304290fcabda5a6b4 Using key wrap algorithm: AES KeyWrap/Wrapped Creating certificate request CRMFPopClient: use_shared_secret true. Generating SubjectKeyIdentifier extension. Creating signer Creating POP Creating CRMF request Storing CRMF request into example.csr Storing CRMF request key id into example.csr.keyIdNoteTo create an EC key pair and CSR, pass the -a ec -t false options to the command. For further details about the parameters, see the output of the
CRMFPopClient --helpcommand.The keypair private key ID generated in the output is saved to a file with the name format
<CSR output file name>.keyId. This ID will be used later on when following the Shared Secret or DecryptedPOP CMC enrollment procedure.Optionally, verify that the CSR is correct:
$ cat example.csr -----BEGIN CERTIFICATE REQUEST----- MIICzzCCAbcCAQAwgYkx ... -----END CERTIFICATE REQUEST-----
For the next steps, skip to Section 5.3.2.2.2, “Authenticating for certificate enrollment using a shared secret”.
5.3. Requesting and receiving certificates using CMC Copy linkLink copied to clipboard!
This section describes the procedure to enroll a certificate using Certificate Management over CMS (CMC).
For general information about configuration and the workflow of enrolling certificates using CMC, see:
- 9.6 Configuration for CMC in the Planning, Installation and Deployment Guide (Common Criteria Edition).
- 2.4.1.1.2.2 Enrolling with CMC in the Planning, Installation and Deployment Guide (Common Criteria Edition).
-
CMCRequest(1)man page -
CMCResponse(1)man page
CMC enrollment is possible in various ways to meet the requirements for different scenarios. Section 5.3.1, “The CMC enrollment process” supplements 2.4.1.1.2.2 Enrolling with CMC in the Planning, Installation and Deployment Guide (Common Criteria Edition) with more details. Additionally, the Section 5.3.2, “Practical CMC enrollment scenarios” section enables administrators to decide which mechanisms should be used in which scenario.
5.3.1. The CMC enrollment process Copy linkLink copied to clipboard!
The most commonly used CMC enrollment process is the agent-approved certificate enrollment:
- The user generates a CSR and sends the CSR to a CA agent
-
Once a CSR is received, the CA agent (configured by "Setting up certificate and role for a pki agent" in the Planning, Installation and Deployment Guide (Common Criteria Edition)) creates a CMC request against the CSR, and sends the request to the CA via
HttpClient - Once the certificate is issued successfully, the CA agent then sends the certificate to back to the requesting user
- The user then imports the newly issued certificate into their nssdb where the CSR was originally generated
The rest of this section provides a more detailed procedure to issue a certificate using CMC:
The requesting user starts by creating a Certificate Signing Request (CSR) in one of the following formats:
- PKCS #10 format
- Certificate Request Message Format (CRMF) format
Next, the requesting user should send the CSR (e.g. /user_or_entity_database_directory/request.csr) to the user who holds the CA agent role.
Approving the CSR as a CA Agent
As the CA agent, switch to the nssdb directory that contains the agent certificate:
# cd /home/agent_username/.dogtag/nssdb/Place the CSR in the directory:
# cp request.csr /home/agent_username/.dogtag/nssdb/After you have placed the CSR in the directory, create a configuration file for a CMC request, such as
cmc-request.cfg, with the following content:# NSS database directory where CA agent certificate is stored dbdir=/home/agent_username/.dogtag/nssdb/ # NSS database password password=password # Token name (default is internal) tokenname=internal # Nickname for signing certificate nickname=ca_agent # Request format: pkcs10 or crmf format=<type of CSR format> # Total number of PKCS10/CRMF requests numRequests=1 # Path to the PKCS10/CRMF request # The content must be in Base-64 encoded format. # Multiple files are supported. They must be separated by a space. input=/home/agent_username/.dogtag/nssdb/request.csr # Path for the CMC request output=/home/agent_username/.dogtag/nssdb/cmc-request.binFor further details, see the
CMCRequest(1)man page.Create the CMC request:
$ CMCRequest cmc-request.cfg cert/key prefix = path = /home/agent_username/.dogtag/nssdb CryptoManger initialized token internal logged in... got signerCert: ca_agent createPKIData: begins k=0 createPKIData: format: pkcs10 useSharedSecret is false... signData: begins: getPrivateKey: got signing cert signData: got signer privKey createSignedData: begins getSigningAlgFromPrivate: begins. getSigningAlgFromPrivate: found signingKeyType=RSA getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest createSignedData: digest created for pkidata createSignedData: digest algorithm =RSASignatureWithSHA256Digest createSignedData: building cert chain signData: signed request generated. getCMCBlob: begins getCMCBlob: generating signed data The CMC enrollment request in base-64 encoded format: . . . output omitted . . . The CMC enrollment request in binary format is stored in /home/agent_username/.dogtag/nssdb/cmc-request.binIf the command succeeds, the
CMCRequestutility stored the CMC request in the file specified in theoutputparameter in the request configuration file.Create a configuration file for
HttpClient, such ascmc-submit.cfg, to use in a later step to submit the CMC request to the CA. Add the following content to the created file:# CA server host name host=server.example.com # CA server port number port=8443 # Use secure connection secure=true # Use client authentication clientmode=true # NSS database directory where the CA agent certificate is stored. dbdir=/home/agent_username/.dogtag/nssdb/ # NSS database password password=password # Token name (default: internal) tokenname=internal # Nickname of signing certificate nickname=ca_agent # Path for the CMC request input=/home/agent_username/.dogtag/nssdb/cmc-request.bin # Path for the CMC response output=/home/agent_username/.dogtag/nssdb/cmc-response.binImportantThe nickname of the certificate specified in the
nicknameparameter must match the one previously used for the CMC request.Depending on what type of certificate you request, add the following parameter to the configuration file created in the previous step:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=profile_nameFor example, for a CA signing certificate:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCcaCertImportantWhen an agent submits the CMC request in the next step, the profile specified in this parameter must use the
CMCAuthauthentication plugin. Whereas in user-initiated enrollments, the profile must use theCMCUserSignedAuthplugin. For further details, see the Section 8.3, “CMC authentication plugins”.Submit the CMC request to the CA:
$ HttpClient cmc-submit.cfg Total number of bytes read = 6271 after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key client cert is not null handshake happened writing to socket Response Headers begin HTTP/1.1 200 Content-Type: application/pkcs7-mime Content-Length: 4227 Date: Fri, 19 Jan 2024 20:57:26 GMT Connection: close end . . . Output omitted . . . The response in binary format is stored in home/agent_username/.dogtag/nssdb/cmc-response.binTo convert the CMC response to a PKCS #7 certificate chain, pass the CMC response file to the
-iparameter of theCMCResponseutility. For example:$ CMCResponse -i /home/user_name/cmc-response.bin -o /home/user_name/cert_chain.crtImportantRunning
CMCResponsewith the "-v" option returns the PEM of each certificate in the chain asCert:0,Cert:1etc. Below all the PEMs, the output also displays each certificate in the chain in pretty print format. Since the certificates are not displayed in a fixed order, in order to determine their position in the chain, you must examine the "Subject:" under each "Certificate". The corresponding PEM is displayed in the same position above.Once the certificate is issued successfully, the CA agent then sends the certificate back to the requesting user. The user can then import the certificate into their nssdb. For example:
# pki -d /user_or_entity_database_directory/ -c <password> client-cert-import "user_name certificate" --cert cert_chain.crt
5.3.2. Practical CMC enrollment scenarios Copy linkLink copied to clipboard!
This section describes frequent practical usage scenarios and their workflows to enable CA administrators to decide which CMC method to use in which situation.
For a general process of enrolling a certificate using CMC, see Section 5.3.1, “The CMC enrollment process”.
5.3.2.1. Obtaining system and server certificates Copy linkLink copied to clipboard!
If a service, such as LDAP or a web server, requires a TLS server certificate, the administrator of this server creates a CSR based on the documentation of the service and sends it to the CA’s agent for approval. Use the procedure described in Section 5.3.1, “The CMC enrollment process” for this process. Additionally, consider the following requirements:
- Enrollment Profiles
-
The agent must either use one of the existing CMC profiles listed in Section 8.3, “CMC authentication plugins”, or, alternatively, create a custom profile that uses the
CMCAuthauthentication mechanism. - CMC Signing Certificate
For system certificates, the CA agent must generate and sign the CMC request. For this, set the
nicknameparameter in theCMCRequestconfiguration file to the nickname of the CA agent.NoteThe CA agent must have access to its own private key.
HttpClientnicknameparameter-
Use the same certificate for signing in the
CMCRequestutility’s configuration file as for TLS mutual authentication in the configuration file forHttpClient. HttpClientservletparameterThe
servletin the configuration file passed to theHttpClientutility refers to the CMC servlet and the enrollment profile which handles the request.Depending on what type of certificate you request, add one of the following entries to the configuration file created in the previous step:
For a CA signing certificate:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCcaCertFor a KRA transport certificate:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCkraTransportCertFor an OCSP signing certificate:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCocspCertFor an audit signing certificate:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCauditSigningCertFor a subsystem certificate:
For RSA certificates:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCsubsystemCertFor ECC certificates:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECCsubsystemCert
For a TLS server certificate:
For RSA certificates:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCertFor ECC certificates:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECCserverCert
For an admin certificate:
servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert
Further details:
- When an agent pre-signs a CSR, the Proof of Identification is considered established because the agent examines the CSR for identification. No additional CMC-specific identification proof is required.
- PKCS #10 files already provide Proof of Possession information and no additional Proof of Possession (POP) is required.
-
In agent pre-approved requests, the
PopLinkWitnessV2feature must be disabled because the identification is checked by the agent.
5.3.2.2. Obtaining the first signing certificate for a user Copy linkLink copied to clipboard!
There are two ways to approve a user’s first signing certificate:
- An agent signs the CMC request. See Section 5.3.2.2.1, “Signing a CMC Request with an agent certificate”.
- Certificate enrollment is authenticated by using a Shared Secret. See Section 5.3.2.2.2, “Authenticating for certificate enrollment using a shared secret”.
5.3.2.2.1. Signing a CMC Request with an agent certificate Copy linkLink copied to clipboard!
The process for signing a CMC request with an agent certificate is the same as for obtaining system and server certificates, which can be found in Section 5.3.1, “The CMC enrollment process”.
5.3.2.3. Obtaining an encryption-only certificate for a user Copy linkLink copied to clipboard!
This section describes the workflow for obtaining an encryption-only certificate which is signed with an existing user signing certificate:
If a user owns multiple certificates for different usages, where one is signing, the user must obtain the signing certificate first. Once the user owns a signing certificate, it can be used for Proof Of Origin without requiring to set up and rely on the CMC Shared Secret mechanism.
For details about obtaining a user’s first signing certificate, see Section 5.3.2.2, “Obtaining the first signing certificate for a user”.
As a user:
- Use the cryptographic token stored in a Network Security Services (NSS) database or on a smart card that contains the user’s signing certificate and keys.
Generate the CSR in PKCS #10 or the CRMF format.
NoteUse the CRMF format, if key archival is required.
Generate the CMC request.
Since this is an encryption-only certificate, the private key is not able to sign. Therefore, Proof Of Possession (POP) is not included. For this reason, the enrollment requires two steps: If the initial request is successful, results in a CMC status with the
EncryptedPOPcontrol. The user then uses the response and generates a CMC request that contains theDecryptedPOPcontrol and submits it in the second step.For the first step, in addition to the default parameters, the user must set the following parameters in the configuration file passed to the
CMCRequestutility:-
identification.enable -
witness.sharedSecret -
identityProofV2.enable -
identityProofV2.hashAlg -
identityProofV2.macAlg -
popLinkWitnessV2.enableif required by the CA -
popLinkWitnessV2.keyGenAlgif required by the CA -
popLinkWitnessV2.macAlgif required by the CA request.privKeyIdFor details, see the
CMCRequest(1)man page.The response contains:
- A CMC encrypted POP control
-
The
CMCStatusInfoV2control with thePOP requirederror - The request ID
-
For the second step, in addition to the default parameters, the user must set the following parameters in the configuration file passed to the
CMCRequestutility:-
decryptedPop.enable -
encryptedPopResponseFile -
decryptedPopRequestFile -
request.privKeyId -
oaep=true
-
For details, see the
CMCRequest(1)man page.
5.3.2.3.1. Example on obtaining an encryption-only certificate with Key Archival Copy linkLink copied to clipboard!
To perform an enrollment with key archival, generate a CMC request that contains the user’s encrypted private key in the CRMF request. The following procedure assumes that the user already owns a signing certificate. The nickname of this signing certificate is set in the configuration files in the procedure.
The following procedure describes the two-trip issuance used with encryption-only keys, which cannot be used for signing. If you use a key which can sign certificates, pass the -q POP_SUCCESS option instead of -q POP_NONE to the CRMFPopClient utility for a single-trip issuance.
The procedure for obtaining an encryption-only certificate requires generating a CRMF request using CRMPopClient with the POP_NONE option only. For instructions about using CRMFPopClient with POP_SUCCESS, see Section 5.2.3.1, “Using CRMFPopClient to create a CSR with key archival” and Section 5.2.3.2, “Using CRMFPopClient to create a CSR for SharedSecret-based CMC”.
Generating a CSR
Change to the certificate database directory of the user or entity for which the certificate is being requested, for example:
$ cd /home/user_name/.dogtag/nssdb/Search for the KRA transport certificate. For example:
$ pki -p 8443 ca-cert-find --name "DRM Transport Certificate"Use the serial number of the KRA transport certificate, which you retrieved in the previous step, to store the certificate in a file. For example, to store the certificate with the 12345 serial number in the
kra.transportfile:$ pki -p 8443 ca-cert-export 12345 --output kra.transportUse the
CRMFPopClientutility to create a CRMF request with POP_NONE, where the RSA private key is wrapped by the KRA transport certificate. For example, to generate and store the request in the/home/user_name/.dogtag/nssdb/crmf.reqfile:$ CRMFPopClient -d . -p token_password -n "cn=subject_name" -q POP_NONE -b kra.transport -w "AES KeyWrap/Wrapped" -v -o crmf.req -oaep Initializing security database: . archival option enabled Loading transport certificate Parsing subject DN RDN: CN=subject_name Generating key pair: temporary: false CryptoUtil: generateRSAKeyPair: calling kg.setKeyPairUsages Keypair private key id: 2500b867acad0064bdba3fde9762a3ff1487fcfa Using key wrap algorithm: AES KeyWrap/Wrapped Creating certificate request Creating CRMF request Storing CRMF request into crmf.req Storing CRMF request key id into crmf.req.keyId
CMCRequest first trip (EncryptedPop)
Create a configuration file for the
CMCRequestutility, such ascmc-crmf-request.cfgwith the following content:#numRequests: Total number of PKCS10 requests or CRMF requests. numRequests=1 #input: full path for the PKCS10 request or CRMF request, #the content must be in Base-64 encoded format input=/home/user_name/.dogtag/nssdb/crmf.req #output: full path for the CMC request in binary format output=/home/user_name/.dogtag/nssdb/cmc-round_1.req #tokenname: name of token where agent signing cert can be found #(default is internal) tokenname=internal #nickname: nickname for user certificate which will be used #to sign the CMC full request. nickname=signing_certificate #dbdir: directory for cert9.db, key4.db and pkcs11.txt dbdir=/home/user_name/.dogtag/nssdb/ #password: password for cert9.db which stores the agent certificate password=password #format: request format, either pkcs10 or crmf format=crmf decryptedPop.enable=false request.selfSign=falseCreate the CMC request:
$ CMCRequest cmc-crmf-request.cfg cert/key prefix = path = /home/user_name/certs_db CryptoManger initialized token internal logged in... got signerCert: signing_certificate createPKIData: begins k=0 createPKIData: format: crmf useSharedSecret is false... signData: begins: getPrivateKey: got signing cert signData: got signer privKey createSignedData: begins getSigningAlgFromPrivate: begins. getSigningAlgFromPrivate: found signingKeyType=EC getSigningAlgFromPrivate: using SignatureAlgorithm: ECSignatureWithSHA256Digest createSignedData: digest created for pkidata createSignedData: digest algorithm =ECSignatureWithSHA256Digest createSignedData: building cert chain signData: signed request generated. getCMCBlob: begins getCMCBlob: generating signed data The CMC enrollment request in base-64 encoded format: . . . output omitted . . . The CMC enrollment request in binary format is stored in /home/user_name/.dogtag/nssdb/cmc-round_1.reqIf the command succeeds, the
CMCRequestutility stored the CMC request in the file specified in theoutputparameter in the request configuration file.Create a configuration file for
HttpClient, such ascmc-submit.cfg, to use in a later step to submit the CMC request to the CA. Add the following content to the created file:#host: host name for the http server host=server.example.com #port: CA port number port=8443 #secure: true for secure connection, false for nonsecure connection secure=true #input: full path for the enrollment request, the content must be in #binary format input=/home/user_name/.dogtag/nssdb/cmc-round_1.req #output: full path for the response in binary format output=/home/user_name/.dogtag/nssdb/cmc-response_round_1.bin #tokenname: name of token where TLS mutual authentication cert can be found #(default is internal) #This parameter will be ignored if secure=false tokenname=internal #dbdir: directory for cert9.db, key4.db and pkcs11.txt #This parameter will be ignored if secure=false dbdir=/home/user_name/.dogtag/nssdb/ #clientmode: true for client authentication, false for no client authentication #This parameter will be ignored if secure=false clientmode=true #password: password for cert9.db #This parameter will be ignored if secure=false and clientauth=false password=password #nickname: nickname for client certificate #This parameter will be ignored if clientmode=false nickname=signing_certificate #servlet: servlet name servlet=/ca/ee/ca/profileSubmitUserSignedCMCFull?profileId=caFullCMCUserSignedCertSubmit the CMC request to the CA:
$ HttpClient cmc-submit.cfg Total number of bytes read = 5578 after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key client cert is not null handshake happened writing to socket Response Headers begin HTTP/1.1 200 Content-Type: application/pkcs7-mime Content-Length: 3317 Date: Thu, 25 Jan 2024 21:58:32 GMT Connection: close End Total number of bytes read = 3317 . . . output omitted . . . The response in binary format is stored in /home/user_name/.dogtag/nssdb/cmc-response_round_1.binIf the command succeeds, the
HTTPClientutility stored the CMC response in the file specified in theoutputparameter in the configuration file.Verify the response by passing the response file to the
CMCResponseutility. For example:$ CMCResponse -d /home/user_name/.dogtag/nssdb/ -i /home/user_name/.dogtag/nssdb/cmc-response_round_1.binIf the first trip was successful,
CMCResponsedisplays an output similar to the following:Certificates: Certificate: Data: Version: v3 Serial Number: 0x425C240 Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11 Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA Validity: Not Before: Thursday, September 28, 2023 4:06:41 PM EDT America/New_York Not After: Monday, September 28, 2043 4:06:41 PM EDT America/New_York Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA ... Number of controls is 3 Control #0: CMC encrypted POP OID: {1 3 6 1 5 5 7 7 9} encryptedPOP decoded Control #1: CMCStatusInfoV2 OID: {1 3 6 1 5 5 7 7 25} BodyList: 1 OtherInfo type: FAIL failInfo=POP required Control #2: CMC ResponseInfo requestID: 15 CMC Full Response. ERROR: CMC status for [1]: pop required
CMCRequest second trip (DecryptedPop)
For the second trip, create a configuration file for
DecryptedPOP, such as/home/user_name/.dogtag/nssdb/cmc_DecryptedPOP.cfg, which you use in a later step.#numRequests: Total number of PKCS10 requests or CRMF requests. numRequests=1 #input: full path for the PKCS10 request or CRMF request, #the content must be in Base-64 encoded format #this field is actually unused in the 2nd trip input=/home/user_name/.dogtag/nssdb/crmf.req #output: full path for the CMC request in binary format #this field is actually unused in 2nd trip output=/home/user_name/.dogtag/nssdb/cmc2.req #tokenname: name of token where agent signing cert can be found #(default is internal) tokenname=internal #nickname: nickname for agent certificate which will be used #to sign the CMC full request. nickname=signing_certificate #dbdir: directory for cert9.db, key4.db and pkcs11.txt dbdir=/home/user_name/.dogtag/nssdb/ #password: password for cert9.db which stores the agent #certificate password=password #format: request format, either pkcs10 or crmf format=crmf decryptedPop.enable=true request.selfSign=false oaep=true encryptedPopResponseFile=/home/user_name/.dogtag/nssdb/cmc-response_round_1.bin request.privKeyId=-25aa0a8aad395ebac7e6a19c364f0dcb5350cfef decryptedPopRequestFile=/home/user_name/.dogtag/nssdb/cmc.DecryptedPOP.reqNoteFor the
request.privKeyId=parameter value, enter the private key ID that was saved into the keyId file after runningCRMFPopClient, e.g.crmf.req.keyId.Create the
DecryptPOPCMC request:$ CMCRequest /home/user_name/cmc.DecryptedPOP.cfg cert/key prefix = path = /home/user_name/.dogtag/nssdb CryptoManger initialized token internal logged in... got signerCert: signing_certificate got request privKeyId: -5db9e71d7f6fbf8cca8dba3f933aa1beea69fb5f got private key processEncryptedPopResponse: begins. processEncryptedPopResponse: previous response read. processEncryptedPopResponse: Number of controls is 3 processEncryptedPopResponse: Control #0: CMC encrypted POP processEncryptedPopResponse: OID: {1 3 6 1 5 5 7 7 9} processEncryptedPopResponse: encryptedPOP decoded successfully processEncryptedPopResponse: Control #1: CMCStatusInfoV2 processEncryptedPopResponse: OID: {1 3 6 1 5 5 7 7 25} processEncryptedPopResponse: BodyList: 1 processEncryptedPopResponse: OtherInfo type: FAIL processEncryptedPopResponse: failInfo=POP required processEncryptedPopResponse: what we expected, as decryptedPOP.enable is true; processEncryptedPopResponse: Control #2: CMC ResponseInfo processEncryptedPopResponse: requestID: 256 processEncryptedPopResponse: ends constructDecryptedPopRequest: begins constructDecryptedPopRequest: previous response parsed. constructDecryptedPopRequest: symKey unwrapped. constructDecryptedPopRequest: challenge decrypted. constructDecryptedPopRequest: Yay! witness verified constructDecryptedPopRequest: calculating POP Proof Value constructDecryptedPopRequest: popProofValue length = 32 constructDecryptedPopRequest: constructing DecryptedPOP... constructDecryptedPopRequest: DecryptedPOP constructed successfully constructDecryptedPopRequest: adding decryptedPop control constructDecryptedPopRequest: decryptedPop control added constructDecryptedPopRequest: regInfo control added constructDecryptedPopRequest: completes. useSharedSecret is false... signData: begins: getPrivateKey: got signing cert signData: got signer privKey createSignedData: begins getSigningAlgFromPrivate: begins. getSigningAlgFromPrivate: found signingKeyType=EC getSigningAlgFromPrivate: using SignatureAlgorithm: ECSignatureWithSHA256Digest createSignedData: digest created for pkidata createSignedData: digest algorithm =ECSignatureWithSHA256Digest createSignedData: building cert chain signData: signed request generated. getCMCBlob: begins getCMCBlob: generating signed data The CMC enrollment request in base-64 encoded format: . . . output omitted . . The CMC enrollment request in binary format is stored in /home/user_name/.dogtag/nssdb/cmc.DecryptedPOP.reqIf the command succeeds, the
CMCRequestutility stored the CMC request in the file specified in thedecryptedPopRequestFileparameter in the request configuration file.Create a configuration file for
HttpClient, such asdecrypted_POP_cmc-submit.cfg, to use in a later step to submit theDecryptedPOPCMC request to the CA. Add the following content to the created file:#host: host name for the http server host=server.example.com #port: CA port number port=8443 #secure: true for secure connection, false for nonsecure connection secure=true #input: full path for the enrollment request, the content must be in binary format input=/home/user_name/.dogtag/nssdb/cmc.DecryptedPOP.req #output: full path for the response in binary format output=/home/user_name/.dogtag/nssdb/cmc-response_round_2.bin #tokenname: name of token where TLS mutual authentication cert can be found (default is internal) #This parameter will be ignored if secure=false tokenname=internal #dbdir: directory for cert9.db, key4.db and pkcs11.txt #This parameter will be ignored if secure=false dbdir=/home/user_name/.dogtag/nssdb/ #clientmode: true for client authentication, false for no client authentication #This parameter will be ignored if secure=false clientmode=true #password: password for cert9.db #This parameter will be ignored if secure=false and clientauth=false password=password #nickname: nickname for client certificate #This parameter will be ignored if clientmode=false nickname=signing_certificate #servlet: servlet name servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserSignedCertSubmit the
DecryptedPOPCMC request to the CA:$ HttpClient decrypted_POP_cmc-submit.cfg Total number of bytes read = 5676 after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key client cert is not null handshake happened writing to socket Response Headers begin HTTP/1.1 200 Content-Type: application/pkcs7-mime Content-Length: 4210 Date: Fri, 26 Jan 2024 00:41:57 GMT Connection: close end Total number of bytes read = 4210 . . . output omitted . . . The response in binary format is stored in /home/user_name/.dogtag/nssdb/cmc-response_round_2.binIf the command succeeds, the
HTTPClientutility stored the CMC response in the file specified in theoutputparameter in the configuration file.To convert the CMC response to a PKCS #7 certificate chain, pass the CMC response file to the
-iparameter of theCMCResponseutility. For example:$ CMCResponse -i cmc-response_round_2.bin -o encryption_only_certs.p7Alternatively, to display the individual certificates in PEM format, pass the -v to the utility.
If the second trip was successful,
CMCResponsedisplays output similar to the following:Certificates: Certificate: Data: Version: v3 Serial Number: 0x35EEA2A Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11 Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA Validity: Not Before: Thursday, January 25, 2024 5:09:51 PM EST America/New_York Not After: Tuesday, July 23, 2024 5:09:51 PM EDT America/New_York Subject: CN=user_name,UID=example,OU=keyArchivalExample . . . Number of controls is 1 Control #0: CMCStatusInfoV2 OID: {1 3 6 1 5 5 7 7 25} BodyList: 1 Status: SUCCESS CMC Full Response. PKCS#7 now stored in file: encryption_only_certs.p7Once the certificate is issued successfully, the user can then import the certificate into their own
/home/user_name/.dogtag/nssdb/database. For example:# pki -d /home/user_name/.dogtag/nssdb/ -c <password> client-cert-import "user_name certificate" --cert encryption_only_certs.p7
5.4. Renewing certificates Copy linkLink copied to clipboard!
This section explains how to use the different types of certificate renewal described in Section 3.4.1, “The renewal process”. You can use the methods described in this section to renew a certificate both with and without agent approval. To renew a certificate as a user without agent approval, use profiles that require the CMCUserSignedAuth authentication plugin, and to renew with agent approval, use profiles that require the CMCAuth authentication plugin. For further details about these plugins and in which profiles they are enabled by default, see Section 8.3, “CMC authentication plugins”.
Renewal Using the Same Key
Section 5.3.1, “The CMC enrollment process” describes how to request and issue a certificate using CMC. When a user submits the same CMC request created during this process again with the same enrollment profile, Certificate System renews the certificate with the same key.
For renewing a certificate as the user using the same key, the enrollment profile must contain the uniqueKeyConstraint entry with the params.allowSameKeyRenewal parameter set to True as described in Section 3.4.1, “The renewal process”.
Renewal Using a New Key
To renew a certificate using a new key, follow the procedure described in Section 5.3.1, “The CMC enrollment process”. The process for renewal is the same as for a new enrollment. When you sign the request with the same signing certificate, the newly issued certificate contains the same subjectDN attribute as the signing certificate.
5.5. Linking between an issued certificate and CSR Copy linkLink copied to clipboard!
This section details how a CA agent can trace an issued certificate to the original submitted CSR, and from a CSR to an issued certificate.
Tracing from CSR to issued certificate
If a certificate request has been approved successfully, a CA agent can do the following to search for the request and see the CSR matching the certificate:
-
Access
https://host_name:port/ca/agent/ca. - Click Search for Requests.
-
Select and fill in Request ID Range (for example
12for Lowest Request ID and12for Highest Request ID). - Select Request Type and choose enrollment type.
- Select Request Status and choose completed status
- Make sure everything else is unselected.
- Click Submit.
- Click on the request number. You see the certificate in clear text at this point.
To display the CSR and certificate linking, right-click and select This Frame and View Frame Source.
-
Search for
inputList.inputName="Certificate Request";. The request is theinputList.inputValbelow that. -
Search for
outputList.outputSyntax="pretty_print";. The certificate is theoutputList.outputValbelow that.
-
Search for
-
Access
Tracing from issued certificate to CSR:
-
Access
https://host_name:port/ca/agent/ca. - Click Find.
- Click Details.
- You see the certificate in clear text, along with a Request ID link. Click on the link to open the Request page.
To display the certificate and CSR linking:
-
Search for
inputList.inputName="Certificate Request";. The request is theinputList.inputValbelow that. -
Search for
outputList.outputSyntax="pretty_print";. The certificate is theoutputList.outputValbelow that.
-
Search for
You can also use the CLI to find the certificate request for a certificate in the CA database, for example:
$ pki-server ca-cert-request-find --cert-file <cert file>
Where the certificate file has the following requirements:
- The certificate must be base-64 encoded.
-
Each line must be at most 64 bytes long and terminated with
CRLF. -
There is no
BEGIN/END CERTIFICATEheader/footer.