.net、php、cgi などで CSR をデコードする方法
のような出力で
CN OU OLS C
PHPで簡単:
$csr=$_POST['txtcsr']; // Copy CSR to a variable
$data=openssl_csr_get_subject($csr); // Get the subject of the CSR
print_r($data); // Print the output as an array:
出力: 配列 ( [C] => US [ST] => ミネソタ [L] => Shakopee [O] => テスト組織 [OU] => IT アーキテクチャ [CN] => your.domain [emailAddress] => your. @email.com)
ヒント: 関数を機能させるには、サーバーに OPENSSL_CNF 環境変数が正しく設定されている必要があります。
たとえば、php および python の OpenSSL モジュールを見てください。 PHP OpenSSL Python OpenSSL PHP のopenssl_x509_parse()関数 を確認するか、proc_open、os.popen などを使用して openssl ツールを呼び出し、すべてのジョブを実行して結果を取得できます。