473,385 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

openssl

Hi,

if I feed a certificate to openssl_x509_parse($smimepublickey), the
returned array contains
....
[purposes] => Array
...
[4] => Array
(
[0] => 1
[1] =>
[2] => smimesign
)
....

but when I feed the same cert to

openssl_x509_checkpurpose($smimepublickey, X509_PURPOSE_SMIME_SIGN) I
get "0" ("false") as return value. These two results contradict each
other, so either this is a bug in PHP or I overlooked an important
detail. Can anyone comment?


Here is the code to reproduce the error:

<?php
$smimepublickey=<<<END
-----BEGIN CERTIFICATE-----
GIICnzCCAgigAwIBAgIDDraxMA1GCSqGSIb3DQEBBAUAMGIxCz AJBgNVBAYTAlpD
....
AQET
-----END CERTIFICATE-----
END;

echo("<pre>\n");
print_r(openssl_x509_parse($smimepublickey));
echo("</pre>\n");
print(openssl_x509_checkpurpose($smimepublickey, X509_PURPOSE_SMIME_SIGN));
?>

Christian
Feb 18 '06 #1
0 1121

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: User1001 | last post by:
I have been trying to enable/use specific OpenSSL extensions that I use in generating certificates manually, via PHP5 + php5-openssl module/extension. Filling out the "configargs" array with...
3
by: nanard | last post by:
Hi,Bonjour, I m running FreeBSD 4.10 STABLE and using Apache 1.3.x and PHP4. Today, i updated php4 from Ports Tree and there was lot of change. Indeed, no more php4-something package... only...
1
by: Niko | last post by:
Hello, I want to retrieve the details of an SSL certificate of HTTPS websites, using openSSL, running on Windows 2003. This works fine as follows: openssl s_client www.somewebsite.com:443 >...
0
by: John Bergstrom | last post by:
Hello everyone! I wrote a simple perl program to encrypt a string using Crypt::OpenSSL::RSA. Everything as described in the module documentation. The public key is a valid X.509 encrypted...
2
by: Christopher Murtagh | last post by:
Greetings, I'm trying to build 7.3.4 and I've come across two problems, one during the configure and the other afterward. Problem 1) Trying to build with openssl support gives this: ...
17
by: cpptutor2000 | last post by:
Could some C guru please help me? I have a simple piece of code as: #include <stdio.h> #include <stdlib.h> #include <openssl/rand.h> int main(){ unsigned char temp; RAND_bytes(temp, 4);
1
by: laredotornado | last post by:
Hello, I downloaded PHP 4.4.4 and am trying to install for Apache 2 on Fedora Core 5. However when trying to configure with openssl, I get this error, configure: error: Cannot find...
4
by: Patrick | last post by:
Hello, I'm currently trying the OpenSSL Library, but I got some problems. I want to create a server and client application that communicate through the OpenSSL API, but this code doesn't work. I...
5
by: Chuck Anderson | last post by:
I run Apache 2.0.55, and Php (both 4.4.1 and 5.2.5) on my home PC (Windows XP). One of the scripts that I run daily needs to access a secure URL (https://..............). When I am running Php4,...
4
by: Tan | last post by:
Hi folk, I'm trying to install latest OpenSSL version in VS2008 Express Edition on WinXP. I have downloaded and installed the redistributable for VC+ +2008 (including SP1), and also installed...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.