Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2013-11-08
4
Medium Priority
?
1,770 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 65

Accepted Solution

by:
btan earned 2000 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 65

Expert Comment

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

Featured Post

2017 Webroot Threat Report

MSPs: Get the facts you need to protect your clients.
The 2017 Webroot Threat Report provides a uniquely insightful global view into the analysis and discoveries made by the Webroot® Threat Intelligence Platform to provide insights on key trends and risks as seen by our users.

Question has a verified solution.

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

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …
Suggested Courses
Course of the Month12 days, 1 hour left to enroll

916 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