(PHP 5 >= 5.2.2, PHP 7)
openssl_pkcs12_read — Parst ein PKCS#12 Zertifikatsarchiv in ein Array
$pkcs12
, array &$certs
, string $pass
) : bool
openssl_pkcs12_read() parst das im Parameter
PKCS12 übergebene PKCS#12 Zertifikatsarchiv in das im
Parameter certs angegebene Array.
PKCS12Der Inhalt des Zertifikatsarchivs, nicht sein Dateiname.
certsEnthält im Erfolgsfall die Zertifikatsarchivdaten als Array.
passPasswort zum Entschlüsseln der PKCS#12-Datei.
Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben.
Gibt bei Erfolg TRUE zurück. Im Fehlerfall wird FALSE zurückgegeben.
Beispiel #1 openssl_pkcs12_read() Beispiel
<?php
if (!$cert_store = file_get_contents("/certs/file.p12")) {
echo "Fehler: das Zertifikatsarchiv kann nicht gelesen werden\n";
exit;
}
if (openssl_pkcs12_read($cert_store, $cert_info, "my_secret_pass")) {
echo "Zertifikatsinformationen\n";
print_r($cert_info);
} else {
echo "Fehler: das Zertifikatsarchiv kann nicht geparst werden.\n";
exit;
}
?>