ID:               38937
 Updated by:       [EMAIL PROTECTED]
 Reported By:      bassijunior at yahoo dot com dot br
-Status:           Open
+Status:           Bogus
-Bug Type:         Feature/Change Request
+Bug Type:         OpenSSL related
 Operating System: Windows XP
 PHP Version:      5.1.6
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[2006-10-08 04:33:24] bassijunior at yahoo dot com dot br

Hi, 
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-05 11:28:10] [EMAIL PROTECTED]

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)
print_r($details);

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

You can try it using the snapshot: http://snaps.php.net but it will not
be backported to 5.1.

------------------------------------------------------------------------

[2006-10-05 01:34:54] bassijunior at yahoo dot com dot br

No. 
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?

Thanks!

------------------------------------------------------------------------

[2006-10-03 01:02:47] [EMAIL PROTECTED]

By request, do you mean from an url? like https://example.com?

------------------------------------------------------------------------

[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!!

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/38937

-- 
Edit this bug report at http://bugs.php.net/?id=38937&edit=1

Reply via email to