<?php
function sha1_thumbprint_pem($pem_file_contents)
{
$file = $pem_file_contents;
$file = preg_replace('/\-+BEGIN CERTIFICATE\-+/','',$file);
$file = preg_replace('/\-+END CERTIFICATE\-+/','',$file);
$file = trim($file);
$file = str_replace( array("\n\r","\n","\r"), '', $file);
$bin = base64_decode($file);
return sha1($bin);
}
?>
Thursday, December 30, 2010
Calculate sha1 thumbprint of ssl certificate
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment