TOMCATでのCSR作成手順

以下のコマンドを入力します。

 

keytool -genkey -alias sample001 -keyalg RSA -keysize 2048 -keystore sample001.key -validity 360
 

サブジェクト情報の入力
プロンプトが表示されますので、以下のように入力します。

(1)Enter keystore password:
鍵ストアのパスワード入力です。ここではpasswordを入力します。

(2)What is your first and last name? – This is the Common Name (Domain Name)
コモンネーム入力です。ここではwww.sample001.netを入力します。

(3)What is the name of your organizational unit?
部署名を英語(半角英数字)で入力します。

(4)What is the name of your organization?
証明書を申請する組織名を、英語(半角英数字)で入力します。

(5)What is the name of your City or Locality?
証明書を申請する組織の存在する市区町村名を、英語(半角英数字)で入力します。

(6)What is the name of your State or Province?
証明書を申請する組織の存在する都道府県名を、英語(半角英数字)で入力します。

(7)What is the two-letter country code for this unit?
証明書を申請する組織の存在する国名のコードを、英語(半角英数字)2文字で入力します。日本の場合JPです。

入力内容の確認
入力内容一覧が表示されますので、内容を確認して、間違いが無ければ「y」を入力します。

CSRファイルの作成
(1)CSR生成のため、以下のコマンドを入力します。

 

keytool -certreq -keyalg RSA -keysize 2048 -alias sample001 -file sample001.csr -keystore sample001.key
 

(2)パスワードが要求されますのでpasswordを入力します。

sample001.csrをエディタで開きます。
表示された内容の—–BEGIN CERTIFICATE REQUESTから —–END CERTIFICATE REQUEST—–までを全てコピーして、DigiTrust申請画面のCSRに貼り付けてください。