|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38937 openssl_csr_parse()
Submitted: 2006-09-23 20:12 UTC Modified: 2006-10-10 14:39 UTC
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:4 (100.0%)
Same OS:4 (100.0%)
From: bassijunior at yahoo dot com dot br Assigned: pajoye (profile)
Status: Not a bug Package: OpenSSL related
PHP Version: 5.1.6 OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: bassijunior at yahoo dot com dot br
New email:
PHP Version: OS:


 [2006-09-23 20:12 UTC] bassijunior at yahoo dot com dot br
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? 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-02 23:21 UTC] bassijunior at yahoo dot com dot br

Some news about that????? Nobody answers me...

 [2006-10-03 00:17 UTC]
What are you trying to do?

Parse a peer certicate?
 [2006-10-03 00:54 UTC] 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:


$cert = "$pwd\\demoCA\\user_cert_signed.pem";

$fp = fopen ($cert, "rb", 1);
    echo "Erro abrindo arquivo";
$conteudo = addslashes(fread ($fp, filesize($cert)));

//$cert_dados = file_get_contents($cert);




I want to do this with request too, and not only with a certificate. 

 [2006-10-03 01:02 UTC]
By request, do you mean from an url? like
 [2006-10-05 01:34 UTC] bassijunior at yahoo dot com dot br
I am developing a project using the openssl functions in the PHP.
These certificates, that I generate,  aren?t to use as web certificate. I will use this certificate to prove that a user submited a file for me, for example. It's a aplication very unusual.

Condensing, before generate a certificate, I have to generate a request certificate, ok? I do this using openssl_csr_new function.
I only want to know how I can read a certificate request. To read the certificate(.PEM) I use the openssl_X509_parse, how I showed in my last comment, but I also need to read the certificate request. How can I read it? Is there a openssl_????_parse to read a certificate request?

 [2006-10-05 11:28 UTC]
With 5.2.0 or later:

Is it what you are looking for?

$csr = file_get_contents('somecsr');
$csr_details = openssl_csr_get_subject($csr, 1)

and to get the pkey:
$key = openssl_csr_get_public_key($csr);

You can try it using the snapshot: but it will not be backported to 5.1.
 [2006-10-08 04:33 UTC] bassijunior at yahoo dot com dot br
I think so. 
But I don?t know how to use the snapshot.
What can I do to use this? I did a download, but now, apache  doesn?t work.
 [2006-10-08 11:29 UTC]
Snapshots are just like release. You can follow the install instructions in the manual to install them. You can use the CLI (console) to test it.
 [2006-10-08 18:51 UTC] bassijunior at yahoo dot com dot br
I found something in the Internet, but it doesn?t work.
Where can I found a good documentation about that?
And, another thing, do you know when the new version of PHP, the version 5.2 will be available?
 [2006-10-08 21:10 UTC]
5.2 will be released in the next 2-3 weeks. The documentation will be added in the PHP manual.

But what did not work? the 5.2 install?
 [2006-10-10 01:36 UTC] bassijunior at yahoo dot com dot br

I downloaded the PHP 5.2(.zip). Then, I extracted the files to the php directory. After this,  the apache doesn't start.
I'm looking for about the install documentation in the Internet, but I didn't yet found.

 [2006-10-10 13:13 UTC]
All you need is here:

I close this bug, solved (not a bug, bogus, the new functions already exist).
 [2006-10-10 14:39 UTC] bassijunior at yahoo dot com dot br

I will access this site that you recommended.

Thank you very much by your help!!
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Dec 04 12:03:58 2022 UTC