X5T ヘッダーの特定

X5T ヘッダーは、プライベート キー JWT 認証の MS Entra 構成に必要です。

次のいずれかの方法で、X5T ヘッダー値の証明書のサムプリントを特定します。

xxd および openssl コマンドを使用する

xxd および openssl コマンドを使用すると、サムプリント (ハッシュ) の 16 進表現が Base64 エンコード形式に変換されます。

echo <thumbprint> | xxd -r -p | openssl enc -a

以下のコマンドを使用します。

  • echo <thumbprint>: このコマンドはサムプリントを出力します。<thumbprint> を実際のサムプリント文字列に置き換えてください。
  • xxd -r -p: xxd コマンドに -r -p オプションを指定すると、サムプリントの 16 進ダンプが 16 進数から 2 進数に逆変換されます。
  • openssl enc -a: openssl enc -a コマンドは、2 進数のデータを Base64 にエンコードします。

Windows で Certutil と PowerShell を使用する

このコマンドは certutil を使用しますが、 -encode オプションを指定すると、thumbprintbinary の 2 進数のデータが Base64 形式にエンコードされます。

echo <thumbprint>      > thumbprinthex; certutil -f -decodehex thumbprinthex
          thumbprintbinary;      certutil -f -encode thumbprintbinary base64.txt; get-content
          base64.txt |      Where-Object { -not $_.Contains('-----') } | Out-File
        x5t.txt