異なるウェブサーバは、異なるフォーマットの証明書をサポートする。 発行済み証明書をwebサーバーにインストールする前に、証明書の形式をwebサーバーに合わせて変換する必要があります。 This topic describes how to convert the format of a certificate.

You can convert the format of a certificate by using the following methods:
  • JKS証明書ファイルをPFX証明書ファイルに変換する
    JKS証明書ファイルをPFX証明書ファイルに変換するには、Java Development Kit (JDK) に付属のKeytoolツールを使用します。 たとえば、次のコマンドを実行してcert_nameを変換します。証明書ファイルをします。pfx証明書ファイル:
    keytool -importkeystore -srckeystore D:\<cert_name>.jks -destkeystore D:\<cert_name>.pfx
            -srcstoretype JKS -deststoretype PKCS12
    • この例では、証明書名はcert_nameです。 認証局 (CA) 証明書ファイルの名前はcert_nameです。秘密鍵ファイルの名前はcert_name .keyです。 実際のシナリオでは、cert_nameを証明書の名前に置き換える必要があります。
    • Keytoolは、JDKに付属するキー管理ツールです。 Keytoolでは、証明書用のJKS形式のキーストアファイルを作成できます。 Keytoolを取得するには、Java DownloadsからJDKをダウンロードします。 Keytoolは通常、JDK\jre\bin\security\ ディレクトリに格納されます。
  • Convert a PFX certificate file to a JKS certificate file
    JDKに付属のKeytoolツールを使用して、PFX証明書ファイルをJKS証明書ファイルに変換できます。 For example, you can run the following command to convert the cert_name.pfx certificate file to the cert_name.jks certificate file:
    keytool -importkeystore -srckeystore D :\< cert_name>.pfx -destkeystore D :\< cert_name>.jks
            -srcstoretype PKCS12 -deststoretype JKS
  • PEM、KEY、またはCRT証明書ファイルをPFX証明書ファイルに変換する
    OpenSSLツールを使用して、KEY秘密鍵ファイルとPEMまたはCRT CA証明書ファイルをPFX証明書ファイルに変換できます。 詳細については、OpenSSLをご参照ください。 For example, you can copy your KEY private key file cert_name.key and PEM CA certificate file cert_name.pem to the installation directory of the OpenSSL tool. Then, run the following command to convert the files to the cert_name.jks certificate file:
    openssl pkcs12 -export -out <cert_name>.pfx -inkey <cert_name>.key -in <cert_name>.pem
  • PFX証明書ファイルをPEM、KEY、またはCRT証明書ファイルに変換する
    OpenSSLツールを使用して、PFX証明書ファイルをKEY秘密鍵ファイルおよびPEMまたはCRT CA証明書ファイルに変換できます。 詳細については、OpenSSLをご参照ください。 たとえば、PFX証明書ファイルcert_nameをコピーできます。OpenSSLツールのインストールディレクトリにjksします。 Then, run the following commands to convert the PFX certificate file to a CA certificate file cert_name.pem and a KEY private key file cert_name.key:
    openssl pkcs12 -in <cert_name>.pfx -nokeys -out <cert_name>.pem
    openssl pkcs12 -in <cert_name>.pfx -nocerts -out <cert_name>.key -nodes