5.3. CMC を使用した証明書の要求と受信


このセクションでは、CMS (Certificate Management over CMS) を使用して証明書を登録する手順を説明します。

CMC を使用して証明書を登録する設定とワークフローの一般的な情報は、以下を参照してください。

  • 計画、インストール、デプロイメントのガイド (Common Criteria Edition) の 9.6 CMC の設定
  • 計画、インストール、デプロイメントのガイド (Common Criteria Edition) の 2.4.1.1.2.2 CMC を使用した登録
  • CMCRequest(1) man ページ
  • CMCResponse(1) man ページ

CMC の登録は、さまざまなシナリオの要件を満たすためにさまざまな方法で可能です。「CMC 登録プロセス」 は、計画、インストール、デプロイメントのガイド (Common Criteria Edition) の 2.4.1.1.2.2 CMC による登録 を補完しています。さらに、「実用的な CMC 登録シナリオ」 セクションには、管理者がどのメカニズムをどのシナリオで使用するかを決定するための情報が記載されています。

5.3.1. CMC 登録プロセス

最も一般的に使用される CMC 登録プロセスは、エージェント承認証明書登録です。

  1. ユーザーは CSR を生成し、その CSR を CA エージェントに送信します。
  2. CSR を受信した CA エージェント (計画、インストール、デプロイメントのガイド (Common Criteria Edition) の「PKI エージェントの証明書とロールの設定」で設定) は CSR に対する CMC 要求を作成し、その要求を HttpClient 経由で CA に送信します。
  3. 証明書が正常に発行されると、CA エージェントは証明書を要求元のユーザーに送り返します。
  4. ユーザーは、新しく発行された証明書を、最初に CSR が生成された nssdb にインポートします。

このセクションの残りの部分では、CMC を使用して証明書を発行するためのより詳細な手順を説明します。

要求元のユーザーは、まず次のいずれかの形式で証明書署名要求 (CSR) を作成します。

  • PKCS #10 形式
  • Certificate Request Message Format (CRMF) 形式

次に、要求元のユーザーは、CA エージェントロールを持つユーザーに CSR (例: /user_or_entity_database_directory/request.csr) を送信する必要があります。

CA エージェントとして CSR を承認する

  1. CA エージェントとして、エージェント証明書が含まれている nssdb ディレクトリーに切り替えます。

    # cd /home/agent_username/.dogtag/nssdb/
  2. CSR を次のディレクトリーに配置します。

    # cp request.csr /home/agent_username/.dogtag/nssdb/
  3. CSR をディレクトリーに配置した後、次の内容で CMC 要求の設定ファイル (例: cmc-request.cfg) を作成します。

    # 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.bin

    詳細は、CMCRequest(1) の man ページを参照してください。

  4. CMC 要求を作成します。

    $ 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.bin

    コマンドが成功すると、CMCRequest ユーティリティーは、要求設定ファイルの output パラメーターで指定されたファイルに CMC 要求を保存します。

  5. 後の手順で CMC 要求を CA に送信するために使用する HttpClient の設定ファイル (例: cmc-submit.cfg) を作成します。作成されたファイルに以下の内容を追加します。

    # 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.bin
    重要

    nickname パラメーターで指定された証明書のニックネームは、CMC 要求で以前使用された内容と一致する必要があります。

  6. 要求する証明書のタイプに応じて、前の手順で作成した設定ファイルに次のパラメーターを追加します。

    servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=profile_name

    CA 署名証明書の場合の例を以下に示します。

    servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCcaCert
    重要

    エージェントが次のステップで CMC 要求を送信する場合、このパラメーターで指定したプロファイルは CMCAuth 認証プラグインを使用する必要があります。ユーザーが作成した登録では、プロファイルは CMCUserSignedAuth プラグインを使用する必要があります。詳細は、「CMC 認証プラグイン」 を参照してください。

  7. CMC 要求を 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.bin
  8. CMC の応答を PKCS #7 証明書チェーンに変換するには、CMCResponse ユーティリティーの -i パラメーターに CMC 応答ファイルを渡します。以下に例を示します。

    $ CMCResponse -i /home/user_name/cmc-response.bin -o /home/user_name/cert_chain.crt
    重要

    "-v" オプションを指定して CMCResponse を実行すると、チェーン内の各証明書の PEM が Cert:0Cert:1 などとして返されます。この出力では、すべての PEM の下に、チェーン内の各証明書も整った出力形式で表示されます。証明書は決まった順序で表示されないため、チェーン内での位置を確認するには、各 "Certificate" の下にある "Subject:" を確認する必要があります。対応する PEM が上と同じ位置に表示されます。

  9. 証明書が正常に発行されると、CA エージェントは証明書を要求元のユーザーに送り返します。その後、ユーザーは証明書を nssdb にインポートできます。以下に例を示します。

    # pki -d /user_or_entity_database_directory/ -c <password> client-cert-import "user_name certificate" --cert cert_chain.crt

5.3.2. 実用的な CMC 登録シナリオ

このセクションでは、CA 管理者がどの状況でどの CMC メソッドを使用するかを決定できるようにするための、頻繁な実際の使用シナリオとそのワークフローを説明します。

CMC を使用して証明書を登録する一般的なプロセスは、「CMC 登録プロセス」 を参照してください。

5.3.2.1. システム証明書およびサーバー証明書の取得

LDAP や Web サーバーなどのサービスで TLS サーバー証明書が必要な場合、このサーバーの管理者はサービスのドキュメントに基づいて CSR を作成し、承認のために CA のエージェントに送信します。このプロセスには、「CMC 登録プロセス」 で説明されている手順を使用します。また、以下の要件を考慮してください。

登録プロファイル
エージェントは、「CMC 認証プラグイン」 にリストされている既存の CMC プロファイルのいずれかを使用する必要があります。または、CMCAuth 認証メカニズムを使用するカスタムプロファイルを作成します。
CMC 署名証明書

システム証明書の場合、CA エージェントは CMC 要求を生成して署名する必要があります。そのためには、CMCRequest 設定ファイルの nickname パラメーターを CA エージェントのニックネームに設定します。

注記

CA エージェントは、独自の秘密鍵にアクセスできるようにする必要があります。

HttpClient nickname パラメーター
CMCRequest ユーティリティー設定ファイルでの署名には、HttpClient 設定ファイルでの TLS 相互認証と同じ証明書を使用します。
HttpClient servlet パラメーター

HttpClient ユーティリティーに渡される設定ファイルの servlet では、要求を処理する CMC サーブレットおよび登録プロファイルが参照されます。

要求する証明書のタイプに応じて、直前の手順で作成した設定ファイルに以下のエントリーのいずれかを追加します。

  • CA 署名証明書の場合:

    servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCcaCert
  • KRA トランスポート証明書の場合:

    servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCkraTransportCert
  • OCSP 署名証明書の場合:

    servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCocspCert
  • 監査署名証明書の場合:

    servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCauditSigningCert
  • サブシステム証明書の場合:

    • RSA 証明書の場合:

      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCsubsystemCert
    • ECC 証明書の場合:

      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECCsubsystemCert
  • TLS サーバー証明書の場合:

    • RSA 証明書の場合:

      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCserverCert
    • ECC 証明書の場合:

      servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caCMCECCserverCert
  • 管理証明書の場合:

    servlet=/ca/ee/ca/profileSubmitCMCFull?profileId=caFullCMCUserCert

詳細は以下を参照してください。

  • エージェントが CSR を事前署名する場合、エージェントは識別のために CSR を調べるため、Proof of Identification が確立されたと見なされます。追加の CMC 固有の識別証明は必要ありません。
  • PKCS #10 ファイルはすでに Proof of Possession (POP) 情報を提供し、追加の Proof of Possession (POP) は必要ありません。
  • エージェントの事前承認済み要求では、識別はエージェントによってチェックされるため、PopLinkWitnessV2 機能を無効にする必要があります。

5.3.2.2. ユーザーの初回署名証明書の取得

ユーザーの最初の署名証明書を承認する方法は 2 つあります。

5.3.2.2.1. エージェント証明書を使用して CMC 要求に署名する

エージェント証明書を使用して CMC 要求に署名するプロセスは、システム証明書とサーバー証明書を取得する場合と同じです。詳細は 「CMC 登録プロセス」 に記載されています。

5.3.2.2.2. 共有シークレットを使用して証明書登録を認証する

CMC 共有トークンメソッドは、CA エージェントが介入しなくても、非エージェントユーザーが独自のユーザー証明書を安全に登録できるように設計されています。ユーザーが最初の署名証明書を取得したいが、エージェントが、「エージェント証明書を使用して CMC 要求に署名する」 で説明されているように要求を承認できない場合は、共有トークンを使用できます。このトークンを使用すると、ユーザーは最初の署名証明書を取得できます。次に、この証明書を使用してユーザーの他の証明書に署名できます。

このシナリオでは、Shared Secret のメカニズムを使用して、ユーザーの最初の署名証明書を取得します。「CMC 登録プロセス」 とともに以下の情報を使用します。

  1. ユーザーまたは CA 管理者として共有トークンを作成します。詳細は、「共有シークレットトークンの作成」 を参照してください。

    注意: ユーザーがトークンを作成した場合、ユーザーはトークンを CA 管理者に送信する必要があります。CA 管理者がトークンを作成した場合、管理者はユーザーがトークン生成に使用するパスワードを共有する必要があります。セキュアな方法でパスワードを送信します。

  2. CA 管理者として、LDAP のユーザーエントリーに Shared Token を追加します。詳細は、計画、インストール、デプロイメントのガイド (Common Criteria Edition) の 9.6.3 証明書登録用ユーザーエントリーへの CMC 共有シークレットの追加 および CMC 共有シークレット機能の有効化 を参照してください。
  3. CMCRequest ユーティリティーに渡される設定ファイルで以下のパラメーターを使用します。

    • identification.enable
    • identification
    • witness.sharedSecret
    • identityProofV2.enable
    • identityProofV2.hashAlg
    • identityProofV2.macAlg
    • request.useSharedSecret
    • request.privKeyId
  4. CA で必要な場合は、CMCRequest ユーティリティーに渡される設定ファイルで以下のパラメーターも使用します。

    • popLinkWitnessV2.enable
    • popLinkWitnessV2.keyGenAlg
    • popLinkWitnessV2.macAlg

      注記

      CA で popLinkWitness が必要かどうかの詳細は、計画、インストール、デプロイメントのガイド (Common Criteria Edition) の 9.6.2 「PopLinkWitnessV2 機能の有効化」で設定パラメーターの値を確認してください。

  5. CMC 登録設定ファイルでパラメーターがどのように使用されるかについては、以下の例を参照してください。たとえば、要求元ユーザーの nssdb に shrTok_example_request.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/user_name/.dogtag/nssdb/request.csr
    
    ### output: full path for the CMC request in binary format
    output=/home/user_name/.dogtag/nssdb/cmc-request.bin
    
    ### 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. This is not needed for shared secret enrollments.
    #nickname=
    
    ### dbdir: directory for cert8.db, key3.db and secmod.db
    dbdir=/home/user_name/.dogtag/nssdb/
    
    ### password: password for cert8.db which stores the agent certificate
    password=password
    
    ### format: request format, pkcs10 if request is created using PKCS10Client, or crmf if request created using CRMFPopClient
    format=<pkcs10 or crmf>
    
    ### 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
    ### The shared secret passphrase assigned when creating shared token with CMCSharedToken command
    witness.sharedSecret=<shared secret>
    
    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=<The UID of the requesting user in LDAP>
    注記

    共有シークレットを使用した CMC 登録のより完全な例については、計画、インストール、デプロイメントのガイド (Common Criteria Edition) の「CMC 共有トークンのテスト」を参照してください。

5.3.2.3. ユーザーの暗号化専用証明書の取得

このセクションでは、既存のユーザー署名証明書で署名された暗号化のみの証明書を取得するワークフローを説明します。

注記

ユーザーがさまざまな用途で複数の証明書を所有していて、1 つが署名している場合、ユーザーは最初に署名証明書を取得する必要があります。ユーザーが署名証明書を所有すると、CMC Shared Secret メカニズムを設定して依存することなく、Proof Of Origin に使用できます。

ユーザーの最初の署名証明書を取得する方法は、「ユーザーの初回署名証明書の取得」 を参照してください。

ユーザーとして以下を行います。

  1. ユーザーの署名証明書および鍵が格納された Network Security Services (NSS) データベースまたはスマートカードに保存されている暗号化トークンを使用します。
  2. PKCS #10 形式または CRMF 形式で CSR を生成します。

    注記

    (キーのアーカイブが必要な場合は) CRMF 形式を使用してください。

  3. CMC 要求を生成します。

    これは暗号のみの証明書であるため、秘密鍵は署名できません。つまり、Proof Of Possession (POP) は含まれていません。このため、登録には、2 つの手順が必要です。最初の要求が成功すると、EncryptedPOP 制御のある CMC 状態が生じます。次に、ユーザーは応答を使用して、DecryptedPOP 制御を含む CMC 要求を生成し、2 番目のステップで送信します。

    • 最初のステップでユーザーは、CMCRequest ユーティリティーに渡される設定ファイルに、デフォルトのパラメーターに加え次のパラメーターを設定する必要があります。

      • identification.enable
      • witness.sharedSecret
      • identityProofV2.enable
      • identityProofV2.hashAlg
      • identityProofV2.macAlg
      • CA が要求する場合は popLinkWitnessV2.enable
      • CA が要求する場合は popLinkWitnessV2.keyGenAlg
      • CA が要求する場合は popLinkWitnessV2.macAlg
      • request.privKeyId

        詳細は、CMCRequest(1) の man ページを参照してください。

        応答には以下が含まれます。

      • CMC で暗号化された POP コントロール
      • POP required エラーでの CMCStatusInfoV2 コントロール
      • リクエスト ID
    • 次のステップでユーザーは、CMCRequest ユーティリティーに渡される設定ファイルに、デフォルトのパラメーターに加えて次のパラメーターを設定する必要があります。

      • decryptedPop.enable
      • encryptedPopResponseFile
      • decryptedPopRequestFile
      • request.privKeyId
      • oaep=true

    詳細は、CMCRequest(1) の man ページを参照してください。

5.3.2.3.1. キーアーカイブを使用した暗号化専用証明書の取得例

キーアーカイブを使用して登録を実行するには、CRMF 要求にユーザーの暗号化された秘密鍵を含む CMC 要求を生成します。以下の手順は、ユーザーが署名証明書をすでに所有していることを前提としています。この署名証明書のニックネームは、手順の設定ファイルに設定されます。

注記

以下の手順は、署名に使用できない暗号のみの鍵で使用される 2 通の発行を説明します。証明書に署名できるキーを使用する場合は、-q POP_NONE の代わりに -q POP_SUCCESS オプションを、単一トリップ発行のために CRMFPopClient ユーティリティーに渡します。

暗号化専用証明書を取得する手順では、POP_NONE オプションのみを指定した CRMPopClient を使用して CRMF 要求を生成する必要があります。POP_SUCCESSCRMFPopClient を使用する方法は、「CRMFPopClient でキーアーカイブを使用する CSR を作成する」 および 「CRMFPopClient で SharedSecret ベースの CMC の CSR を作成する」 を参照してください。

CSR の生成

  1. 証明書が要求されるユーザーまたはエンティティーの証明書データベースディレクトリーに移動します。以下に例を示します。

    $ cd /home/user_name/.dogtag/nssdb/
  2. KRA トランスポート証明書を検索します。以下に例を示します。

    $ pki -p 8443 ca-cert-find --name "DRM Transport Certificate"
  3. 前の手順で取得した KRA トランスポート証明書のシリアル番号を使用して、証明書をファイルに保存します。たとえば、シリアル番号 12345 の証明書を kra.transport ファイルに保存するには、以下を実行します。

    $ pki -p 8443 ca-cert-export 12345 --output kra.transport
  4. CRMFPopClient ユーティリティーを使用して、POP_NONE で CRMF 要求を作成します。このとき、RSA 秘密鍵は KRA トランスポート証明書によってラップされます。たとえば、要求を生成して /home/user_name/.dogtag/nssdb/crmf.req ファイルに保存するには、以下を実行します。

    $ 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 初回トリップ (EncryptedPop)

  1. 次の内容で、CMCRequest ユーティリティーの設定ファイル (例: cmc-crmf-request.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
    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=false
  2. CMC 要求を作成します。

    $ 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.req

    コマンドが成功すると、CMCRequest ユーティリティーは、要求設定ファイルの output パラメーターで指定されたファイルに CMC 要求を保存します。

  3. 後の手順で CMC 要求を CA に送信するために使用する HttpClient の設定ファイル (例: cmc-submit.cfg) を作成します。作成されたファイルに以下の内容を追加します。

    #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=caFullCMCUserSignedCert
  4. CMC 要求を 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.bin

    コマンドが成功すると、HTTPClient ユーティリティーは、CMC 応答を、設定ファイルの output パラメーターで指定されたファイルに保存します。

  5. 応答ファイルを CMCResponse ユーティリティーに渡して応答を確認します。以下に例を示します。

    $ CMCResponse -d /home/user_name/.dogtag/nssdb/ -i /home/user_name/.dogtag/nssdb/cmc-response_round_1.bin

    最初のトリップが成功すると、CMCResponse は以下のような出力を表示します。

    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 の 2 回目のトリップ (DecryptedPop)

  1. 2 回目のトリップでは、後の手順で使用する DecryptedPOP の設定ファイル (例: /home/user_name/.dogtag/nssdb/cmc_DecryptedPOP.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
    #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.req
    注記

    request.privKeyId= パラメーター値には、CRMFPopClient を実行した後に keyId ファイルに保存された秘密鍵 ID (例: crmf.req.keyId) を入力します。

  2. DecryptPOP CMC 要求を作成します。

    $ 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.req

    コマンドが成功すると、CMCRequest ユーティリティーは、要求設定ファイルの decryptedPopRequestFile パラメーターで指定されたファイルに CMC 要求を保存します。

  3. 後の手順で DecryptedPOP CMC 要求を CA に送信するために使用する、HttpClient の設定ファイル (例: decrypted_POP_cmc-submit.cfg) を作成します。作成されたファイルに以下の内容を追加します。

    #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=caFullCMCUserSignedCert
  4. DecryptedPOP CMC 要求を 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.bin

    コマンドが成功すると、HTTPClient ユーティリティーは、CMC 応答を、設定ファイルの output パラメーターで指定されたファイルに保存します。

  5. CMC の応答を PKCS #7 証明書チェーンに変換するには、CMCResponse ユーティリティーの -i パラメーターに CMC 応答ファイルを渡します。以下に例を示します。

    $ CMCResponse -i cmc-response_round_2.bin -o encryption_only_certs.p7

    または、-v ユーティリティーに渡して個々の証明書を PEM 形式で表示します。

    2 回目のトリップが成功すると、CMCResponse は以下のような出力を表示します。

    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.p7
  6. 証明書が正常に発行されると、ユーザーはその証明書を自分の /home/user_name/.dogtag/nssdb/ データベースにインポートできるようになります。以下に例を示します。

    # pki -d /home/user_name/.dogtag/nssdb/ -c <password> client-cert-import "user_name certificate" --cert encryption_only_certs.p7
Red Hat logoGithubRedditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

© 2024 Red Hat, Inc.