#38937 [Opn->Fbk]: openssl_csr_parse()
| From: | pajoye@php.net | Date: | Tue, 03 Oct 2006 01:02:48 +0000 |
| Subject: | #38937 [Opn->Fbk]: openssl_csr_parse() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-103024@lists.php.net to get a copy of this message | ||
ID: 38937
Updated by: pajoye@php.net
Reported By: bassijunior at yahoo dot com dot br
-Status: Open
+Status: Feedback
Bug Type: Feature/Change Request
Operating System: Windows XP
PHP Version: 5.1.6
New Comment:
By request, do you mean from an url? like https://example.com?
Previous Comments:
------------------------------------------------------------------------
[2006-10-03 00:54:21] bassijunior at yahoo dot com dot br
For example, with a openssl_X509_parse function() I can print the
certificate. But I need to do this with a request created by
openssl_csr_new() function.
I oopen the certificate and I print this:
<?php
.
.
.
$cert = "$pwd\\demoCA\\user_cert_signed.pem";
$fp = fopen ($cert, "rb", 1);
if($fp===false)
{
echo "Erro abrindo arquivo";
exit;
}
$conteudo = addslashes(fread ($fp, filesize($cert)));
//$cert_dados = file_get_contents($cert);
$nome=openssl_x509_parse($conteudo);
print_r($nome["subject"]["CN"]);
print_r($nome["subject"]["C"]);
print_r($nome["subject"]["ST"]);
print_r($nome["subject"]["L"]);
.
.
.
?>
I want to do this with request too, and not only with a certificate.
Thanks!!
------------------------------------------------------------------------
[2006-10-03 00:17:03] pajoye@php.net
What are you trying to do?
Parse a peer certicate?
------------------------------------------------------------------------
[2006-10-02 23:21:05] bassijunior at yahoo dot com dot br
Hi,
Some news about that????? Nobody answers me...
Thanks!!
------------------------------------------------------------------------
[2006-09-23 20:12:18] bassijunior at yahoo dot com dot br
Description:
------------
I need to open a certificate request like one array, like I did with
the X.509 certificate.
To verify a X.509 certificate I use openssl_x509_parse( mixed x509cert
[, bool shortnames]).
And about the certificate request? I want to do the same that i did
with certificate.How Can read it?
Is there any function to do that?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38937&edit=1