(PHP 5 >= 5.2.2, PHP 7, PHP 8)
openssl_pkcs12_read — Bir PKCS#12 Sertifika Deposunu bir diziye çözümler
$pkcs12
, array &$sertifikalar
, string $parola
): bool
pkcs12
ile belirtilen PKCS#12 sertifika deposunu
çözümler ve sertifikaları sertifikalar
dizisine
yerleştirir.
pkcs12
PKCS#12 sertifika deposunun içeriği, dosyası değil.
sertifikalar
İşlem başarılı olursa sertifikalar bu diziye konur.
parola
PKCS#12 dosyasının şifresini açmak için parola.
Başarı durumunda true
, başarısızlık durumunda false
döner.
Örnek 1 - openssl_pkcs12_read() örneği
<?php
if (!$cert_store = file_get_contents("/certs/file.p12")) {
echo "Hata: Sertifika dosyası okunamadı\n";
exit;
}
if (openssl_pkcs12_read($cert_store, $cert_info, "parola_burada")) {
echo "Sertifika Bilgisi\n";
print_r($cert_info);
} else {
echo "Hata: Sertifika deposu okunamadı\n";
exit;
}
?>