4.2.8.2 自己署名証明書の生成
次のステップでは、独自の自己署名証明書を生成する方法を示します:
- 次のように、信頼証明書PKCS12ファイル(
trust.p12
)を作成します:- 管理コンテナのインストールを実行するノードで、ディレクトリを作成し、そのフォルダに移動します。次に例を示します:
mkdir <workdir>/oaa_ssl export WORKDIR=<workdir> cd $WORKDIR/oaa_ssl
- ルート認証局(CA)の4096ビットの秘密キーを生成します:
openssl genrsa -out ca.key 4096
- 自己署名ルートCA証明書(
ca.crt
)を作成します:
求められた場合は、CA作成の詳細を入力します。たとえば:openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:US State or Province Name (full name) []:California Locality Name (eg, city) [Default City]:Redwood City Organization Name (eg, company) [Default Company Ltd]:Example Company Organizational Unit Name (eg, section) []:Security Common Name (eg, your name or your server's hostname) []:OAA Certificate Authority Email Address []:
- CA証明書のPKCS12ファイルを生成します:
求められた場合は、エクスポート・パスワードを入力して確認します。openssl pkcs12 -export -out trust.p12 -nokeys -in ca.crt
ノート:
エクスポート・パスワードの設定は必須です。
- 管理コンテナのインストールを実行するノードで、ディレクトリを作成し、そのフォルダに移動します。次に例を示します:
- 次のように、サーバー証明書PKCS12ファイル(
cert.p12
)を作成します:- サーバー証明書の4096ビット秘密キー(
oaa.key
) を生成します:openssl genrsa -out oaa.key 4096
- 証明書署名リクエスト(
cert.csr
)を作成します:
求められた場合は、証明書署名リクエスト(CSR)作成の詳細を入力します。たとえば:openssl req -new -key oaa.key -out cert.csr
You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [XX]:US State or Province Name (full name) []:California Locality Name (eg, city) [Default City]:Redwood City Organization Name (eg, company) [Default Company Ltd]:Example Company Organizational Unit Name (eg, section) []:Security Common Name (eg, your name or your server's hostname) []:oaa.example.com Email Address []: Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []:
- 作成しておいたCAを使用して、CSRから証明書を生成します:
openssl x509 -req -days 1826 -in cert.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out oaa.crt
- 秘密キーとサーバー証明書からPKCS12ファイル(
cert.p12
)を生成します:
求められた場合は、エクスポート・パスワードを入力して確認します。openssl pkcs12 -export -out cert.p12 -inkey oaa.key -in oaa.crt -chain -CAfile ca.crt
ノート:
エクスポート・パスワードの設定は必須です。
- サーバー証明書の4096ビット秘密キー(
その他の情報
上で生成したファイルとパスワードは、後で
installOAA.properties
で使用します。たとえば:
common.deployment.sslcert=cert.p12
common.deployment.trustcert=trust.p12
common.deployment.keystorepassphrase=<password>
。ここで、<password>
は、cert.p12
のパスワードですcommon.deployment.truststorepassphrase=<password>
。ここで、<password>
は、trust.p12
のパスワードですcommon.local.sslcert=<PATH_TO>/cert.p12
common.local.trustcert=<PATH_TO>/trust.p12
これらのパラメータの詳細は、「インストール用のプロパティ・ファイルの準備」を参照してください。