1

I'm not a very experienced PHP developer but I have been given the task to check the digest of an x509 certificate. I know that for PHP 5.6 there is a function called openssl_x509_fingerprint() but I need to display the digest on a PHP 5.3 server. Is there an older or alternate function for this one?

Thanks, taiBsu

tai
  • 477
  • 1
  • 5
  • 16
  • possible duplicate of [How to Sign X.509 certificate with RS256 in PHP? Not able to get Valid fingerprint...x5t](http://stackoverflow.com/questions/26800272/how-to-sign-x-509-certificate-with-rs256-in-php-not-able-to-get-valid-fingerpri) – neubert Nov 07 '14 at 18:10

1 Answers1

2

http://php.net/openssl-x509-certificate . Doesn't look like the function that you're thinking is in 5.6 actually is.

Anyway, using phpseclib, you could do this:

<?php
include('File/X509.php');

$x509 = new File_X509();
$result = $x509->loadX509(...);
echo $result['signature'];
formytar
  • 36
  • 1
  • I'm sorry, I was meaning openssl_x509_fingerprint() function, not certificate() ... – tai Nov 07 '14 at 08:38