Solved

Decode a PEM file in openssl using php (web based form)

Posted on 2013-11-08
4
1,495 Views
Last Modified: 2014-01-12
Hi team,

   We work a lot with SSL certificates and we are looking for a php based solution where we just paste the certificate PEM file on a form on a web page, click submit then get the full details of the certificate we are working with....something similar to what this page is doing    --> http://www.sslshopper.com/certificate-decoder.html.  

We have a recent Centos/Apache web server in our office, but no one knows php.

Would appreciate if someone could post the code snippet that can let us do this.

Thanks very much.
0
Comment
Question by:rleyba828
  • 2
  • 2
4 Comments
 
LVL 62

Accepted Solution

by:
btan earned 500 total points
ID: 39636064
typically openssl is used
http://php.net/manual/en/function.openssl-x509-read.php

extract example:

// Get a certificate resource from the PEM string.
    $cert = openssl_x509_read( $pemdata );

// Parse the resource and print out the contents.
    $cert_data = openssl_x509_parse( $cert );
    array_walk( $cert_data, 'print_element' );
0
 

Author Comment

by:rleyba828
ID: 39636310
Thanks breadtan....let me try that out.
0
 

Author Comment

by:rleyba828
ID: 39774311
Hi Breadtan....sorry for the delayed reply.  thanks for pointing me in the right direction.
0
 
LVL 62

Expert Comment

by:btan
ID: 39774366
no worries, glad it helped
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question