Last active
August 29, 2015 14:07
-
-
Save Klowner/94513a3c931741fca938 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Read the Google Services Account pkcs12 key and return the fingerprint. | |
// This is not important for functionality, but will allow the user to | |
// cross-reference their uploaded fingerprint with the one displayed in the | |
// Google credentials management page. | |
function get_google_services_key_fingerprint () { | |
global $google_services_key_path; | |
$certs = array(); | |
openssl_pkcs12_read(file_get_contents($google_services_key_path), $certs, "notasecret"); | |
if (sizeof($certs) > 0) { | |
$output = $certs['cert']; | |
$output = preg_replace('/\-{5}[A-Z\ ]*\-{5}/', '', $output); | |
return sha1(base64_decode($output)); | |
} | |
return ''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment