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

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

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.
Who is Participating?
btanConnect With a Mentor Exec ConsultantCommented:
typically openssl is used

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' );
rleyba828Author Commented:
Thanks breadtan....let me try that out.
rleyba828Author Commented:
Hi Breadtan....sorry for the delayed reply.  thanks for pointing me in the right direction.
btanExec ConsultantCommented:
no worries, glad it helped
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.