7.8. 创建并配置 SubCA (第二部分)


本节继续进行 SubCA 安装,假设您已安装了 OCSP 实例。这样,subCA 的角色用户证书和 TLS 服务器证书将是指向 OCSP 实例的 AIA 扩展。

7.8.1. 发出非引导代理用户证书

在本节中,我们将使用 SubCA 的 bootstrap admin 证书来发布证书 rsa_SubCA_AgentV (代理用户 jsmith),仅限于 PKI 代理角色特权。然后,这个证书可用于批准将来的 CMC 证书请求。

前提条件

  • 以 root 用户身份登录 rhcs10.example.com

为 pki 代理用户创建代理证书

  1. 按照 第 7.12.3 节 “代理用户” 所述的步骤进行操作,获取为 pki 代理用户(如 jsmith)发布的代理证书(本例中为 rsa_SubCA_AgentV)。注意:如该部分开头的说明,如果您只是测试/评估产品,为方便起见,而不是使用非 root 用户(如 jsmith),您可以以 root 用户身份为 rsa_SubCA_AgentV 生成 CSR,与 bootstrap 用户(/root/.dogtag/pki_rsa_rsa_bootstrap_rsa_bootstrap_rsa_bootstrap_rsa_bootstrap_rsa_bootstrap_rsa_bootstrap/certs_db)在同一证书数据库中生成 CSR,并进一步导入到同一证书数据库中。如果您选择这样做,请在以下说明中相应地替换 user/certs_db。

验证:

  1. 显示已安装的 SubCA 的状态:

    # pki-server status rhcs10-RSA-SubCA

    请注意安全代理、Admin 和 pkiconsole URL。

  2. 执行 sanity 测试来验证新的 SubCA Admin 证书是否已成功添加:

    1. 首先,查找在 第 7.7.7.4 节 “测试 CRL 发布” 中创建 user1 证书的序列号:

      # pki -p 31443 -h rhcs10.example.com ca-cert-find --uid user1
    2. 使用 SubCA 代理的凭证将保存放在 user1的证书上:

      # pki -d /home/jsmith/certs_db -n rsa_SubCA_AgentV -p 31443 -h rhcs10.example.com ca-cert-hold <user1 serial number>
  3. 确保在 rhcs10.example.com 上可以访问 SubCA 的 EE 页面。

7.8.2. 替换临时 DS 证书(SubCA)

SubCA 安装完成后,它可以为 Directory 服务器发布官方 SSL 服务器证书来替换临时证书。为目录服务器证书创建证书签名请求(CSR),然后使用 SubCA 代理用户(rsa_SubCA_AgentV)凭证将此请求提交到 CA。

注意

确保您使用 DS 服务器的 FQDN,如 cn=rhds11.example.com / host=rhds11.example.com

为真实 DS 证书生成 CSR

rhds11.example.com 上,为真实 DS 证书生成 PKCS10 证书签名请求:

  1. 停止 DS :

    # dsctl slapd-CC-RSA-SubCA-LDAP stop
  2. 使用 certutil 工具生成 CSR:

    # certutil -R -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP -s "CN=rhds11.example.com" -g 2048 -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -a -o /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.csr -z /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/noise.txt
    重要

    编辑上面获取的 Server-Cert-subca.csr 输出文件,以删除"Begin Certificate Request"前的几行。例如:

    # vi /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.csr

    CSR 文件必须以"-----BEGIN CERTIFICATE REQUEST-----"行开头,并以"-----END CERTIFICATE REQUEST-----"行结尾。

  3. 启动 DS :

    # dsctl slapd-CC-RSA-SubCA-LDAP start
  4. 远程将 Server-Cert-subca.csr 文件复制到 CA 所在的系统中。例如:

    # scp /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.csr root@rhcs10.example.com:/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.csr

发出真实 DS 证书

rhcs10.example.com 上,发布实际的 SSL 服务器证书:

  1. 生成 CMC 请求:

    1. 创建 CMCRequest 配置文件。例如:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.cfg
      ### 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.
      ### Multiple files are supported. They must be separated by a space.
      ### For input on a different host, specify where to find the CSR.
      input=/root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.csr
      
      ### output: full path for the CMC request in binary format
      ### For output on a different host, specify the destination.
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. 使用 CMCRequest 命令生成请求:

      # CMCRequest /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: PKI Bootstrap Administrator for RSA-SubCA
      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
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.req
  2. 提交 CMC 请求:

    1. 创建 HttpClient 配置文件。例如:

      # vim /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-subca.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### 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=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.req
      
      ### output: full path for the response in binary format
      output=/root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/root/.dogtag/pki_rsa_bootstrap/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=PKI Bootstrap Administrator for RSA-SubCA
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCertWithCRLDP
      注意

      对于 EC 证书,通过设置来使用 ECC 配置集:

      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECserverCertWithCRLDP
    2. 使用 HttpClient 命令提交请求:

      # HttpClient /root/.dogtag/pki_rsa_bootstrap/certs_db/HttpClient_dirsrv-subca.cfg
      
      Total number of bytes read = 3096
      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: 2492
      Date: Tue, 29 Sep 2020 15:20:21 GMT
      Connection: close
      ##end##
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.resp
  3. 处理 CMC 响应:

    1. 使用 CMCResponse 处理响应,以 PEM 格式单独以链的形式显示所有证书:

      重要

      使用 "-v" 选项运行 CMCResponse 将链中每个证书的 PEM 返回为 Cert:0, Cert:1 等。在所有 PEM 下,输出也会以用户打印格式显示链中的每个证书。由于证书没有以固定顺序显示,因此为了确定其在链中的位置,您必须检查每个 "Certificate" 下的"Subject: "。对应的 PEM 显示在上面的同一位置。

      # CMCResponse -d /root/.dogtag/pki_rsa_bootstrap/certs_db -i /root/.dogtag/pki_rsa_bootstrap/certs_db/cmc.dirsrv-subca_pkcs10.resp -v
      
      Cert:0
      ...
      ===
      Cert:1
      ...
      ===
      Cert:2
      ...
      ===
      Certificates:
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0xA383694
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-SubCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:41:36 AM EDT America/New_York
                      Not  After: Monday, March 25, 2024 8:41:36 AM EDT America/New_York
                  Subject: CN=rhds11.example.com
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x5C8FAD4
                  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: Tuesday, April 5, 2022 8:36:21 AM EDT America/New_York
                      Not  After: Saturday, April 5, 2042 8:36:21 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
          Certificate:
              Data:
                  Version:  v3
                  Serial Number: 0x80296C3
                  Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                  Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-RootCA,O=Example-rhcs10-RSA-SubCA
                  Validity:
                      Not Before: Tuesday, April 5, 2022 8:39:43 AM EDT America/New_York
                      Not  After: Friday, April 5, 2041 8:39:43 AM EDT America/New_York
                  Subject: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA
      
      . . . Output omitted . . .
      
      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.
    2. 将新 Server-Cert DS 证书保存到 bootstrap 证书目录(例如 /root/.dogtag/pki_rsa_bootstrap/certs_db/)中的文件中。.pem 文件必须以 header -----BEGIN CERTIFICATE----- 开头,并以 footer -----END CERTIFICATE----- 结束。例如:

      # vi /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.pem

      其中 Server-Cert-subca.pem 是 Directory Server 实例的新的 Server-Cert 证书,充当 SubCA 的 internaldb。

      注意

      RootCA 的签名证书应与以下命令的输出匹配:

      # certutil -L -d /var/lib/pki/rhcs10-RSA-RootCA/alias/ -n "CA Signing Cert - rhcs10-RSA-RootCA" -a
  4. 远程将新的 Server-Cert 证书复制到 rhds11.example.com。例如:

    # scp /root/.dogtag/pki_rsa_bootstrap/certs_db/Server-Cert-subca.pem root@rhds11.example.com:/etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/

替换临时 DS 证书

rhds11.example.com 上,将临时 DS 证书替换为实际的 DS 证书:

  1. 停止 SubCA 的 LDAP 实例:

    # dsctl slapd-CC-RSA-SubCA-LDAP stop
  2. dirsrv 目录的内容保存到备份目录中:

    # cp -r /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ /etc/dirsrv/save-rsa/slapd-CC-RSA-SubCA-LDAP/
  3. 删除旧的 DS 证书:

    # certutil -D -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -n "Server-Cert"
    # certutil -D -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -n "Self-Signed-CA"
  4. 逐个导入新创建的 DS 证书和 CA 证书。例如:

    # certutil -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-RootCA" -i /opt/pki_rsa/rootCA.pem
    # certutil -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -A -t "CT,C,C" -n "CA Signing Cert - rhcs10-RSA-SubCA" -i /opt/pki_rsa/subCA.pem
    # certutil -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/ -f /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/pwdfile.txt -A -t "u,u,u" -n "Server-Cert" -i /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/Server-Cert-subca.pem
  5. 列出证书:

    # certutil -L -d /etc/dirsrv/slapd-CC-RSA-SubCA-LDAP/
    
    Certificate Nickname                         Trust Attributes
                                                 SSL,S/MIME,JAR/XPI
    CA Signing Cert - rhcs10-RSA-RootCA          CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA           CT,C,C
    Server-Cert                                  u,u,u
  6. 启动 DS :

    # dsctl slapd-CC-RSA-SubCA-LDAP start
  7. 测试以确认 LDAP 服务器已启动并在运行(如果是单独的系统,则在 CA 主机上进行测试):

    # ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123

    如果在单独的系统上测试,请在 ldapsearch 命令前面包含 CA 证书链,例如:

    # LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapsearch -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -b "dc=example,dc=com" -w SECret.123

删除 SubCA 实例的临时 DS 证书的信任

rhcs10.example.com 上,从 SubCA 实例数据库中删除临时 DS 证书:

  1. 停止 SubCA:

    # pki-server stop rhcs10-RSA-SubCA
  2. 列出证书:

    # certutil -L -d /var/lib/pki/rhcs10-RSA-SubCA/alias/
    
    Certificate Nickname                    Trust Attributes
                                            SSL,S/MIME,JAR/XPI
    DS temp CA certificate                  CT,C,C
    ...
  3. 从 nssdb 中删除临时证书:

    # certutil -D -d /var/lib/pki/rhcs10-RSA-SubCA/alias/ -n "DS temp CA certificate"

启用证书撤销检查

现在,Directory 服务器证书已被替换,我们可以通过启用证书撤销检查来查看在 CA 启动过程中检测到 CRL 发布点:

  1. 要启用证书撤销检查,在相应的 /var/lib/pki/rhcs10-RSA-SubCA/conf/server.xml 文件中:

    1. enableOCSPenableRevocationCheck 设置为 true

      enableOCSP=true
      or
      enableRevocationCheck=true
    2. 另外,删除这两个参数及其分配的值:

      ocspResponderURL
      ocspResponderCertNickname
  2. 通过编辑 CA 的 CS.cfg 文件并将以下内容设置为 false 来禁用旧的撤销检查方法:

    auths.revocationChecking.enabled=false
  3. 启动 SubCA 实例:

    # pki-server start rhcs10-RSA-SubCA

验证 CRL 发布点

现在,我们使用配置文件 caCMCserverCertWithCRLDP 替换了从属 CA 的目录服务器的 server-cert,在启动与其内部目录服务器的连接时,这有效地触发 CA 引用的 CRL 分发点。

本节提供了一种基本方法来验证 CA 中的 CRL 分发点设置(请参阅 第 7.6.6 节 “配置对 CRL 分发点的支持”):

  1. 检查基于文件的 CRL 发布:

    #  ls -l /var/lib/pki/rhcs10-RSA-SubCA/crl
    total 4
    -rw-r--r--. 1 pkiuser pkiuser 573 Jun 21 18:43 ServerCertCRL-20240621-175339.der
    lrwxrwxrwx. 1 pkiuser pkiuser  67 Jun 21 18:43 ServerCertCRL.crl -> /var/lib/pki/rhcs10-RSA-SubCA/crl/ServerCertCRL-20240621-175339.der
  2. 显示并验证 CRL 的内容

    # BtoA /var/lib/pki/rhcs10-RSA-SubCA/crl/ServerCertCRL.crl /var/lib/pki/rhcs10-RSA-SubCA/crl/ServerCertCRL.bin
    # PrettyPrintCrl /var/lib/pki/rhcs10-RSA-SubCA/crl/ServerCertCRL.bin
        Certificate Revocation List:
            Data:
                Version:  v2
                Signature Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Issuer: CN=CA Signing Certificate,OU=rhcs10-RSA-SubCA,O=Example-rhcs10-RSA-RootCA
                This Update: Friday, June 21, 2024 5:53:39 PM EDT America/New_York
                Next Update: Friday, June 21, 2024 9:00:00 PM EDT America/New_York
                Revoked Certificates:
            Extensions:
                Identifier: CRL Number - 2.5.29.20
                    Critical: no
                    Number: 4
            Signature:
                Algorithm: SHA256withRSA - 1.2.840.113549.1.1.11
                Signature:
                    9E:8A:E1:38:C4:B8:EF:E0:34:2A:92:2D:96:F2:7C:DF:
                    71:F8:4E:8E:EF:AD:C1:CA:65:86:BD:27:45:1C:7E:DD:
                    32:E6:16:94:83:E9:83:3F:24:1F:A1:89:74:7E:70:B6:
                    04:20:36:7F:45:9C:A9:6C:7D:63:37:A3:9F:FD:F2:E1:
                    CE:64:FA:D8:75:82:09:42:AB:B6:83:73:40:1A:C7:98:
                    53:BC:65:81:3C:C3:71:D2:12:F9:A6:EA:00:80:B7:D8:
                    A9:56:37:CD:CF:B9:59:64:B1:7F:31:39:16:11:1C:DC:
                    93:64:87:F9:97:CC:EF:58:23:92:77:FC:2E:22:3A:57:
                    AA:D7:7B:D1:1E:2B:3F:AE:FF:17:1A:62:C4:0C:A0:1E:
                    0D:68:00:C4:68:4C:B5:27:4D:4B:DB:33:17:AC:8C:DF:
                    8D:FE:77:EE:B9:B1:17:55:8F:42:A2:5C:84:1B:6F:B8:
                    82:A6:F6:6E:E9:10:37:50:94:C4:33:D3:3C:18:22:7C:
                    D6:6E:5E:89:34:E1:55:F5:80:F6:8F:B9:49:AE:A0:86:
                    2E:B5:8A:B1:00:8C:B0:4C:81:37:A6:BA:D1:7D:77:81:
                    F3:68:6C:16:D6:0A:BA:E7:F6:65:4F:44:A1:5B:31:0F:
                    C2:F7:F9:FE:DC:55:BA:38:F2:AE:AA:34:9E:D0:7D:64:
                    E1:90:68:E2:68:DE:C9:D0:90:26:56:6B:3A:74:AF:E8:
                    CA:55:AE:E8:A1:DF:81:D1:E4:C8:46:DD:E3:12:6D:46:
                    BE:A5:F2:C4:12:4E:15:D5:0F:30:10:3D:77:62:A2:41:
                    F6:85:77:6F:EF:5C:78:0C:FE:F1:C5:4B:C5:C4:69:B5:
                    84:0A:7B:4B:E3:D7:39:9A:66:43:AB:E9:DD:25:8E:EA:
                    58:2F:AD:1D:D4:CD:1A:EE:50:73:B2:0C:F1:29:67:B3:
                    2D:49:E1:54:95:51:9A:36:82:C3:D2:3F:32:7E:73:20:
                    86:0F:28:6F:CC:89:9F:DF:4A:A9:64:CD:30:4A:80:EE
重要

不要删除 CRL 文件(soft link file ServerCertCRL.crl,及其关联的 der 文件)。

如果您遇到缺少 CRL 文件的情况,或者意外从 /var/lib/pki/rhcs10-RSA-SubCA/crl/ 中删除,防止 CA 启动,请按照以下步骤重新生成 CRL 文件:

  1. 停止 CA 服务。

    # pki-server stop rhcs10-RSA-SubCA
  2. 在 CA 的 server.xml 中,将 enableRevocationCheckenableOCSP 参数设置为 false (如果它当前设置为 true)。
  3. 在 CA 的 CS.cfg 中,将 ca.crl.ServerCertCRL.publishOnStart= 参数设置为 true
  4. 启动 CA 服务以重新生成缺少的 CRL 文件:

    # pki-server start rhcs10-RSA-SubCA
  5. 恢复 CRL 文件后,再次停止 CA 服务。
  6. 在 CA 的 CS.cfg 中,将 ca.crl.ServerCertCRL.publishOnStart= 参数恢复为 false
  7. 在 CA 的 server.xml 中将 enableRevocationCheckenableOCSP 参数设置为 true
  8. 再次启动 CA 服务以应用更改。

按照以下步骤,您将成功恢复缺少的 CRL 文件,并确保 CA 可以正确启动。

验证 CA 是否正常工作

  1. 列出 CA 中的证书:

    # pki -p 31443 ca-cert-find
  2. 以 bootstrap admin 用户身份,列出 SubCA 中的用户:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db/ -c SECret.123 -p 31443 -n "PKI Bootstrap Administrator for RSA-SubCA" ca-user-find

7.8.3. 增加 SubCA pkiconsole 超时

rhcs10.example.com 上:

  1. 停止 SubCA:

    # pki-server stop rhcs10-RSA-SubCA
  2. 编辑 /var/lib/pki/rhcs10-RSA-SubCA/conf/server.xml 以增加超时时间:

    <Connector name="Secure" port="31443" …
    connectionTimeout="3000000"
  3. 启动 SubCA:

    # pki-server start rhcs10-RSA-SubCA

7.8.4. 设置 CMC 共享 Secret 身份验证

CMC Shared Secret 身份验证允许预授权用户进行证书颁发,而无需手动从代理进行交互。配置需要以下内容:

  • CA CS.cfg 中的信息,以指定要用于此类身份验证的 LDAP
  • 启用验证方法
  • 创建颁发保护证书,它提供保护共享 secret 的机制
注意

CMC SharedToken 功能需要使用 OAEP 在 CA 端嵌套/解封。如果 CA 使用的 HSM 不支持算法,并且 CMC Shared Token 是您希望使用的功能,建议您将其设置为内部加密令牌(nssdb)中。在这种情况下,请注意 第 7.8.4.2 节 “添加颁发保护证书” 中的三个区别:

  • 在 nssdb 中为 Issuance 保护证书生成 CSR:

    # PKCS10Client -d /var/lib/pki/rhcs10-RSA-SubCA/alias -a rsa -l 2048 -n "CN=IssuanceProtectionSystemCert" -w -o /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr
  • 将颁发保护证书导入到 nssdb 中:

    # certutil -A -d /var/lib/pki/rhcs10-RSA-SubCA/alias -i /root/.dogtag/pki_rsa_bootstrap/IssuanceProtectionSystemCert.pem -n "IssuanceProtectionSystemCert" -t ""
  • 当指示编辑 CS.cfg 来为 Issuance Protection Certificate 设置 nickname: ca.cert.issuance_protection.nickname=IssuanceProtectionSystemCert

7.8.4.1. 设置 CMC 共享令牌

这部分论述了 CMC Shared Token 身份验证的配置,特定于 LDAP 和配置文件启用。

流程

rhcs10.example.com 上:

  1. 停止 SubCA:

    # pki-server stop rhcs10-RSA-SubCA
  2. 可选步骤 : 要将 shrTok 属性添加到 LDAP,请使用 ldapmodify 命令,并在每个 interactive > 提示符中输入所需的信息。例如:

    # LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapmodify -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -w SECret.123 << EOF
    
    > dn: cn=schema
    > changetype: modify
    > add: attributetypes
    > attributetypes: ( 2.16.840.1.117370.3.1.123 NAME 'shrTok' DESC 'User Defined ObjectClass for SharedToken' SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE X-ORIGIN 'custom for sharedToken')
    > EOF
    
    modifying entry "cn=schema"
  3. 通过编辑 /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg 来添加 SharedToken 身份验证插件,来设置以下属性:

    auths.instance.SharedToken.ldap.basedn=dc=example,dc=com
    auths.instance.SharedToken.ldap.ldapauth.authtype=BasicAuth
    auths.instance.SharedToken.ldap.ldapauth.bindDN=cn=Directory Manager
    auths.instance.SharedToken.ldap.ldapauth.bindPWPrompt=Rule SharedToken
    auths.instance.SharedToken.ldap.ldapconn.host=rhds11.example.com
    auths.instance.SharedToken.ldap.ldapconn.port=7636
    auths.instance.SharedToken.ldap.ldapconn.secureConn=true
    auths.instance.SharedToken.pluginName=SharedToken
    auths.instance.SharedToken.shrTokAttr=shrTok
  4. 将 SubCA 配置为使用 HSM 进行 CMC 键换行:

    1. 编辑 /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg 并设置: cmc.token=NHSM-CONN-XC
    2. 另外,添加以下条目: keyWrap.useOAEP=true
  5. 通过配置,为自签名注册启用 CMC 共享令牌注册配置集,如下所示:

    1. 确保启用了注册配置集 caFullCMCSharedTokenCert.cfg (enable=true)。例如:

      # cat /var/lib/pki/rhcs10-RSA-SubCA/ca/profiles/ca/caFullCMCSharedTokenCert.cfg | grep enable=
      
      enable=true
    2. 如果显示 enable=false,请通过编辑 caFullCMCSharedTokenCert.cfg 来更改 enable=true
  6. 启动 SubCA 以应用更改:

    # pki-server start rhcs10-RSA-SubCA

7.8.4.2. 添加颁发保护证书

CMC 共享令牌身份验证需要额外的设置,即生成 颁发保护证书 以导入到 CA。

注意

颁发保护证书必须是 RSA 证书。

为 Issuance Protection 证书生成证书请求

  1. root 身份登录 rhcs10.example.com
  2. 使用 PKCS10Client 工具生成 PKCS10 证书请求:

    # echo "<YourHSMpassword>" > /root/.dogtag/pki_rsa_bootstrap/certs_db/hsm_pass.txt
    # PKCS10Client -d /var/lib/pki/rhcs10-RSA-SubCA/alias -h NHSM-CONN-XC -P /root/.dogtag/pki_rsa_bootstrap/certs_db/hsm_pass.txt -a rsa -l 2048 -n "CN=IssuanceProtectionSystemCert" -w -o /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr
    
    CryptoUtil: generateRSAKeyPair: calling kg.setKeyPairUsages
    PKCS10Client: Certificate request written into /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr
    PKCS10Client: PKCS#10 request key id written into /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr.keyId
  3. 将生成的证书请求 /root/.dogtag/pki_rsa_bootstrap/certs_db/IssuanceProtectionSystemCert.csr 发送到 pki 代理(如 jsmith)。

    注意

    在本节开始时,在 第 7.8.1 节 “发出非引导代理用户证书” 中,如果您决定将 SubCA Agent' 的证书导入到 /root/.dogtag/pki_rsa_bootstrap/certs_db/ 中,而不是 jsmith的 nssdb,您可以跳过这一步,并以 root 用户身份执行以下步骤。

发出颁发保护证书

  1. 验证 rsa_SubCA_AgentV 是否具有正确的证书。以下两个命令应该生成相同的证书:

    # certutil -L -d /home/jsmith/certs_db -n "rsa_SubCA_AgentV" -a
    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-show rsa_SubCA_AgentV <Cert ID> --encoded
    注意

    您可以使用以下命令获取 Cert ID:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -n "PKI Bootstrap Administrator for RSA-SubCA" -c SECret.123 -h "rhcs10.example.com" -p 31443 ca-user-cert-find rsa_SubCA_AgentV
  2. rhcs10.example.com 上以 jsmith身份登录
  3. 将收到的证书请求文件( IssuanceProtectionSystemCert.csr )放在代理自己的目录中,如 /home/jsmith/certs_db
  4. 生成 CMC 请求:

    1. 创建 CMCRequest 配置文件。例如:

      # vi /home/jsmith/certs_db/cmc_IssuanceProtectionSystemCert_pkcs10.cfg
      ### 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.
      ### Multiple files are supported. They must be separated by a space.
      input=/home/jsmith/certs_db/IssuanceProtectionSystemCert.csr
      
      ### output: full path for the CMC request in binary format
      output=/home/jsmith/certs_db/IssuanceProtectionSystemCert.req
      
      ### tokenname: name of the token where the agent signing cert can be found (default is internal)
      tokenname=internal
      
      ### nickname: nickname for the agent certificate that will be used to sign the CMC full request.
      nickname=rsa_SubCA_AgentV
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/home/jsmith/certs_db
      
      ### password: password for cert8.db that stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
    2. 使用 CMCRequest 命令生成请求:

      # CMCRequest /home/jsmith/certs_db/cmc_IssuanceProtectionSystemCert_pkcs10.cfg
      
      cert/key prefix =
      path = /root/.dogtag/pki_rsa_bootstrap/certs_db
      CryptoManger initialized
      token internal logged in...
      got signerCert: CA agentV
      createPKIData: begins
      k=0
      createPKIData:  format: pkcs10
      PKCS10: PKCS10: begins
      PKCS10: PKCS10: ends
      selfSign is false...
      signData: begins:
      getPrivateKey: got signing cert
      signData:  got signer privKey
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=EC
      getSigningAlgFromPrivate: using SignatureAlgorithm: ECSignatureWithSHA512Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =ECSignatureWithSHA512Digest
      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/jsmith/certs_db/IssuanceProtectionSystemCert.req
  5. 提交 CMC 请求:

    1. 创建 HttpClient 配置文件。例如:

      # vi /home/jsmith/certs_db/HttpClient_IssuanceProtectionSystemCert.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### 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/jsmith/certs_db/IssuanceProtectionSystemCert.req
      
      ### output: full path for the response in binary format
      output=/home/jsmith/certs_db/IssuanceProtectionSystemCert.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/home/jsmith/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=true
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=rsa_SubCA_AgentV
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCcaIssuanceProtectionCert
    2. 使用 HttpClient 命令提交请求:

      # HttpClient /home/jsmith/certs_db/HttpClient_IssuanceProtectionSystemCert.cfg
      
      Total number of bytes read = 2210
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      client cert is not null
      handshake happened
      writing to socket
      Total number of bytes read = 1790
      
      . . . Output omitted . . .
      
      The response in binary format is stored in
      /home/jsmith/certs_db/IssuanceProtectionSystemCert.resp
  6. 获取 CMC 响应:

    # CMCResponse -d /home/jsmith/certs_db -i /home/jsmith/certs_db/IssuanceProtectionSystemCert.resp -o /home/jsmith/certs_db/IssuanceProtectionSystemCert.crt
    
    Certificates:
        Certificate:
        Data:
        Version:  v3
        Serial Number: 0x37C05EC
        Signature Algorithm: SHA512withRSA - 1.2.840.10045.4.3.2
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
       OID: {1 3 6 1 5 5 7 7 25}
       BodyList: 1
       Status: SUCCESS
    PKCS#7 now stored in file: /home/jsmith/certs_db/IssuanceProtectionSystemCert.crt

    请注意序列号。它应该与运行以下命令时显示的相同序列号匹配:

    # pki -d /root/.dogtag/pki_rsa_bootstrap/certs_db -p 31443 -n "PKI Bootstrap Administrator for RSA-SubCA" ca-cert-find --name "IssuanceProtectionSystemCert"
  7. 将 Issuance Protection 证书导入到代理 nssdb 中,以便在 CMC SharedSecret 注册时处理密码短语嵌套:

    # pki -d /home/jsmith/certs_db -c SECret.123 -n "IssuanceProtectionSystemCert" client-cert-import --cert /home/jsmith/certs_db/IssuanceProtectionSystemCert.crt --trust ",,"

将颁发保护证书导入到 CA

  1. 以请求证书的 root 用户身份登录 rhcs10.example.com
  2. 导入颁发保护证书:

    # pki -p 31443 ca-cert-export <issuance protection cert ID> --output-file /root/.dogtag/pki_rsa_bootstrap/IssuanceProtectionSystemCert.pem
    # certutil -A -d /var/lib/pki/rhcs10-RSA-SubCA/alias -h NHSM-CONN-XC -P NHSM-CONN-XC -i /root/.dogtag/pki_rsa_bootstrap/IssuanceProtectionSystemCert.pem -n "IssuanceProtectionSystemCert" -t "" -f /root/.dogtag/pki_rsa_bootstrap/certs_db/hsm_pass.txt
    
    certutil: could not change trust on certificate: SEC_ERROR_TOKEN_NOT_LOGGED_IN: The operation failed because the PKCS#11 token is not logged in.
    注意

    忽略此错误消息(BZ best93668)。

    #  certutil -L -d /var/lib/pki/rhcs10-RSA-SubCA/alias -h NHSM-CONN-XC f /root/.dogtag/pki_rsa_bootstrap/certs_db/hsm_pass.txt
    
    Certificate Nickname                            Trust Attributes
                                                    SSL,S/MIME,JAR/XPI
    
    Enter Password or Pin for NHSM-CONN-XC":
    NHSM-CONN-XC:IssuanceProtectionSystemCert       u,u,u
    ...
  3. 将 SubCA 配置为使用新创建的 IssuanceProtectionSystemCert

    1. 停止 SubCA:

      # pki-server stop rhcs10-RSA-SubCA
    2. 编辑 /var/lib/pki/rhcs10-RSA-SubCA/ca/conf/CS.cfg 来设置
      ca.cert.issuance_protection.nickname=NHSM-CONNC:IssuanceProtectionSystemCert
    3. 启动 SubCA:

      # pki-server start rhcs10-RSA-SubCA

7.8.4.3. 测试 CMC 共享令牌

以下测试步骤包括使用 CMC Shared Token 身份验证使用 issuance 保护来发出用户证书。

为用户设置共享 Secret

作为目录管理器,为 LDAP 用户创建一个 CMC 共享令牌。

  1. 创建常规 OS 用户,如 FooUser123

    # /usr/sbin/useradd -d /home/FooUser123 -s /bin/bash -c "FooUser123" -m FooUser123
  2. 在 LDAP 中添加一个用户。例如,对于 FooUser123 用户,请创建 /root/.dogtag/pki_rsa_bootstrap/certs_db/ldap_cc_rsa_user.ldif 文件,以用于 ldapadd 命令:

    dn: uid=FooUser123,dc=example,dc=com
    objectClass: extensibleobject
    objectclass: inetorgperson
    objectclass: organizationalPerson
    objectClass: person
    objectClass: top
    sn: FooUser123
    uid: FooUser123
    cn: CA FooUser123
    mail: FooUser123@example.com
    givenName: FooUser123
    userPassword: secret
    shrTok:
    # LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapadd -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -w SECret.123 -f /root/.dogtag/pki_rsa_bootstrap/certs_db/ldap_cc_rsa_user.ldif
    
    adding new entry "uid=FooUser123,dc=example,dc=com"
  3. 为用户生成 shrTok 条目。在以下 CMCSharedToken 命令中:

    • s 参数指定共享 secret (如 secretShrTokFooUser123),该 secret 与将执行自签名 CMC 注册的常规用户共享。
    • -n 参数指定 issuance 保护证书的别名。

      # CMCSharedToken -d /home/jsmith/certs_db -p SECret.123 -s secretShrTokFooUser123 -o /root/.dogtag/pki_rsa_bootstrap/cmcSharedTok_FooUser123.b64 -n "IssuanceProtectionSystemCert" --oaep
      
      Encrypted Secret Data:
      MIIBJgSCAQBRCvkCYlEm/6ntzKyQ+FUTbj6KrIfCPW8h9mehkmIDgAtp5vvEzkVNaOz2FZiESE6nXJlQbjODVGuN7XN5F+qORSWFVW1ifnumCw+czeO7OHIenEQ3C7XTwnX77RWoxZECv2tfn818TGR3+YLSJXl8LbSX5qDXv8ydpHAi+GJdtpllnbndA5d8XEKmwg0zRPGsMjJ9t40DA1WEqjVTxxShk4QgxgZxcOYutfj1dtEtMrwcyo9+FRO9MMg4iAWigvAVsMfZphBKCQNAoth+Cv7BZiI45Xtlt6RXQ+x6zgabBwrqn2LIvQ2FBwMhDr+IdDrZdZGAlpci9Q8TUN1Km4A+BCAyc0BksAUX9qX8ylyrrfxaijk3AZyfdnCi6nTXLE+N3A==
      
      Storing Base64 secret data into /root/.dogtag/pki_rsa_bootstrap/cmcSharedTok_FooUser123.b64
  4. 将上述 CMCSharedToken 加密密码短语 secret 数据添加到 LDAP 用户的 shrTok 属性中。例如,创建 /root/.dogtag/pki_rsa_bootstrap/certs_db/ldap_cc_rsa_user_shrtok.ldif 文件,以与 ldapmodify 命令一起使用:

    dn: uid=FooUser123,dc=example,dc=com
    changetype: modify
    replace: shrTok
    shrTok: MIIBJgSCAQBRCvkCYlEm/6ntzKyQ+FUTbj6KrIfCPW8h9mehkmIDgAtp5vvEzkVNaOz2FZiESE6nXJlQbjODVGuN7XN5F+qORSWFVW1ifnumCw+czeO7OHIenEQ3C7XTwnX7RWoxZECv2tfn818TGR3+YLSJXl8LbSX5qDXv8ydpHAi+GJdtpllnbndA5d8XEKmwg0zRGsMjJ9t40DA1WEqjVTxxShk4QgxgZxcOYutfj1dtEtMrwcyo9+FRO9MMg4iAWigvAVsMfZphBKCQNAoth+Cv7BZiI45Xtlt6RXQ+x6zgabBwrqn2LIvQ2FBwMhDr+IdDrZdZGAlpci9Q8UN1Km4A+BCAyc0BksAUX9qX8ylyrrfxaijk3AZyfdnCi6nTXLE+N3A==
    # LDAPTLS_CACERT=/opt/pki_rsa/ca-chain.pem ldapmodify -x -D "cn=Directory Manager" -H ldaps://rhds11.example.com:7636 -w SECret.123 -f /root/.dogtag/pki_rsa_bootstrap/certs_db/ldap_cc_rsa_user_shrtok.ldif
    注意

    确保 shrTok 值在 .ldif 文件中的同一行中,且 "shrTok:" 和值本身之间有一个空格。

测试过程

以测试用户 FooUser123 的身份,

  1. 如果客户端 nssdb 不存在,请创建一个:

    $ pki -d /home/FooUser123/certs_db -c SECret.123 client-init
  2. 将 CA 信任链导入到 nssdb 中:

    $ pki -d /home/FooUser123/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-RootCA" --ca-cert /opt/pki_rsa/rootCA.pem
    $ pki -d /home/FooUser123/certs_db -c SECret.123 client-cert-import "CA Signing Cert - rhcs10-RSA-SubCA" --ca-cert /opt/pki_rsa/subCA.pem
  3. 列出 nssdb 的内容:

    # certutil -d /home/FooUser123/certs_db/ -L
    Certificate Nickname                    Trust Attributes
                                            SSL,S/MIME,JAR/XPI
    
    CA Signing Cert - rhcs10-RSA-RootCA     CT,C,C
    CA Signing Cert - rhcs10-RSA-SubCA      CT,C,C
  4. 创建 PKCS inspect0 请求。生成的请求和私钥 ID 在下一步中在 CMCRequest 文件中使用:

    $ PKCS10Client -d /home/FooUser123/certs_db -p SECret.123 -y true -n "cn=FooUser123, uid=FooUser123, ou=self-signed" -o /home/FooUser123/certs_db/pkcs10.self.req
  5. 显示私钥 ID,使其可用于下一步:

    # cat /home/FooUser123/certs_db/pkcs10.self.req.keyId; echo
  6. 生成 CMC 请求:

    1. 使用您在上一步中获取的 PKCS#10 请求和私钥 ID 创建 CMCRequest 配置文件。例如:

      $ vi /home/FooUser123/certs_db/cmc-p10-self.cfg
      ### 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.
      ### Multiple files are supported. They must be separated by a space.
      input=/home/FooUser123/certs_db/pkcs10.self.req
      
      ### output: full path for the CMC request in binary format
      output=/home/FooUser123/certs_db/cmc.pkcs10.self.req
      
      ### tokenname: name of the token where agent signing cert can be found (default is internal)
      tokenname=internal
      request.useSharedSecret=true
      
      ### nickname: nickname for the agent certificate which will be used to sign the CMC full request.
      #nickname=
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      dbdir=/home/FooUser123/certs_db
      
      ### password: password for cert8.db which stores the agent certificate
      password=SECret.123
      
      ### format: request format, either pkcs10 or crmf
      format=pkcs10
      
      ### identityProofV2.enable: if true, then the request will contain this control. Otherwise, false.
      ### Note that if both identityProof and identityProofV2 are enabled,
      ### identityProofV2 takes precedence; Only one of them can be active at a time
      ### Supported hashAlg are:
      ### SHA-256, SHA-384, and SHA-512
      ### Supported macAlg are:
      ### SHA-256-HMAC, SHA-384-HMAC, and SHA-512-HMAC
      identityProofV2.enable=true
      identityProofV2.hashAlg=SHA-512
      identityProofV2.macAlg=SHA-256-HMAC
      
      ### identityProofV2.sharedSecret: Shared Secret
      witness.sharedSecret=secretShrTokFooUser123
      
      popLinkWitnessV2.enable=true
      popLinkWitnessV2.keyGenAlg=SHA-256
      popLinkWitnessV2.macAlg=SHA-256-HMAC
      
      request.privKeyId=<output from PKCS10Client|CRMFPopClient xxx.priv>
      
      ### identification works with identityProofV2
      identification.enable=true
      identification=FooUser123
    2. 使用 CMCRequest 命令生成请求:

      $ CMCRequest /home/FooUser123/certs_db/cmc-p10-self.cfg
      
      cert/key prefix =
      path = /home/FooUser123/certs_db
      CryptoManger initialized
      token internal logged in...
      got request privKeyId: 2e560e1974669b79b0b71eb096cfe90a2b3db370
      got private key
      
      . . . Output omitted . . .
      
      identification control: identification =FooUser123
      Successfully create identification control. bpid = 1
      
      CMCRequest: addIdentityProofV2Attr: hashAlg=SHA-512; macAlg=SHA-256-HMAC
      Identity Proof V2 control:
       Value: 44 -108 -21 24 76 -10 59 -56 28 -110 -114 -100 -70 40 48 80 24 69 -104 -13 -124 79 75 -42 -92 -29 -89 -27 -37 -107 -91 -82
      Successfully create identityProofV2 control. bpid = 2
      
      selfSign is true...
      signData for selfSign: begins:
      createSignedData: begins
      getSigningAlgFromPrivate: begins.
      getSigningAlgFromPrivate: found signingKeyType=RSA
      getSigningAlgFromPrivate: using SignatureAlgorithm: RSASignatureWithSHA256Digest
      createSignedData: digest created for pkidata
      createSignedData: digest algorithm =RSASignatureWithSHA256Digest
      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/FooUser123/certs_db/cmc.pkcs10.self.req
  7. 提交 CMC 请求:

    1. 创建 HttpClient 配置文件。例如:

      $ vim /home/FooUser123/certs_db/HttpClient-cmc-p10.self.cfg
      ### host: host name for the http server
      host=rhcs10.example.com
      
      ### port: port number
      port=31443
      
      ### 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/FooUser123/certs_db/cmc.pkcs10.self.req
      
      ### output: full path for the response in binary format
      output=/home/FooUser123/certs_db/cmc.p10.self.resp
      
      ### tokenname: name of the token where the SSL client authentication cert can be found (default is internal)
      ### This parameter will be ignored if secure=false
      tokenname=internal
      
      ### dbdir: directory for cert8.db, key3.db and secmod.db
      ### This parameter will be ignored if secure=false
      dbdir=/home/FooUser123/certs_db
      
      ### clientmode: true for client authentication, false for no client authentication
      ### This parameter will be ignored if secure=false
      clientmode=false
      
      ### password: password for cert8.db
      ### This parameter will be ignored if secure=false and clientauth=false
      password=SECret.123
      
      ### nickname: nickname for client certificate
      ### This parameter will be ignored if clientmode=false
      nickname=
      
      ### servlet: servlet name
      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCSharedTokenCert
      注意

      如果您需要 TLS mutual 身份验证来连接到 CS,请参阅 第 7.13.12 节 “为连接到 CS 时需要 TLS 相互身份验证”

    2. 使用 HttpClient 命令提交请求:

      # HttpClient /home/FooUser123/certs_db/HttpClient-cmc-p10.self.cfg
      
      Total number of bytes read = 2966
      after SSLSocket created, thread token is NSS FIPS 140-2 User Private Key
      handshake happened
      writing to socket
      handshake happened
      Total number of bytes read = 1714
      
      . . . Output omitted . . .
      
      The response in binary format is stored in /home/FooUser123/certs_db/cmc.p10.self.resp
  8. 处理 CMCResponse 调用:

    $ CMCResponse -d /home/FooUser123/certs_db -i /home/FooUser123/certs_db/cmc.p10.self.resp
    
    Certificates:
       Certificate:
          Data:
              Version:  v3
              Serial Number: 0x3D58D34
              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: Sunday, February 11, 2018 6:38:08 PM EST America/New_York
                  Not  After: Friday, August 10, 2018 6:38:08 PM EDT America/New_York
              Subject: CN=FooUser123,UID=FooUser123
    
    . . . Output omitted . . .
    
    Number of controls is 1
    Control #0: CMCStatusInfoV2
     OID: {1 3 6 1 5 5 7 7 25}
     BodyList: 1
     Status: SUCCESS

7.8.5. 检查随机序列号

确保所有子系统证书都有随机序列号:

  • 访问 SubCA 的 EE 页面,并列出证书以确认它们有随机序列号。
  • 另外,您可以使用以下命令检查随机序列号:

    # pki -p 31443 ca-cert-find | grep -i serial

7.8.6. 创建其他 SubCA 角色用户

我们之前已经为 rsa_SubCA_AgentV 创建了 代理 角色用户和证书。

另外,您可以按照 第 7.12 节 “创建 PKI 角色用户” 中的步骤为 adminaudit 角色创建其他单角色用户。

  1. 使用 sslclientauth 配置 SubCA 并导入角色用户证书,如 第 7.13.6 节 “使用客户端身份验证配置 pkiconsole 登录” 所述。
  2. 使用角色用户的客户端身份验证证书登录到 pkiconsole

    # pkiconsole -d <home .redhat-idm-console dir> -n <client cert> https://rhcs10.example.com:31443/ca

    然后从列表中选择角色用户证书别名,如 rsa_SubCA_AdminV。登录到控制台应该可以成功。

7.8.8. 安装后

如果要安装其他 RHCS 实例,请继续下一小节。完成所有需要的 RHCS 实例安装后,请访问 第 7.13 节 “安装后” 以完成额外的设置。

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部