How to Decode a CSR in .net,php,cgi,etc
wth a output like
CN OU O L S C
How to Decode a CSR in .net,php,cgi,etc
wth a output like
CN OU O L S C
Easy in 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:
Output: Array ( [C] => US [ST] => Minnesota [L] => Shakopee [O] => Test Organization [OU] => IT Arhitecture [CN] => your.domain [emailAddress] => your@email.com)
Tip: To get the function work, the server must have the OPENSSL_CNF environment variable correctly set.
Look at OpenSSL modules for php and python for example. Php OpenSSL Python OpenSSL You can check php openssl_x509_parse() function or use something like proc_open, os.popen to call openssl tool to do all the job and get results.