Solved

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

Posted on 2013-11-08
4
1,595 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 63

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 63

Expert Comment

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

Featured Post

Put Machine Learning to Work--Protect Your Clients

Machine learning means Smarter Cybersecurity™ Solutions.
As technology continues to advance, managing and analyzing massive data sets just can’t be accomplished by humans alone. It requires huge amounts of memory and storage, as well as high-speed processing of the cloud.

Question has a verified solution.

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

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

751 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