W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
(PHP 5 >= 5.2.2, PHP 7, PHP 8)
openssl_pkcs12_read — 將 PKCS#12 證書存儲區(qū)解析到數(shù)組中
openssl_pkcs12_read(string $pkcs12, array &$certificates, string $passphrase): bool
openssl_pkcs12_read() 將 pkcs12 提供的 PKCS#12 證書存儲區(qū)解析到以 certificates 命名的變量中。
pkcs12
證書存儲內(nèi)容,而不是它的文件名。
certificates
成功,將保存證書存儲數(shù)據(jù)
passphrase
用來解鎖 PKCS#12 文件的解密密碼
成功時返回 true, 或者在失敗時返回 false。
示例 #1 openssl_pkcs12_read() 示例
<?php
if (!$cert_store = file_get_contents("/certs/file.p12")) {
echo "Error: Unable to read the cert file\n";
exit;
}
if (openssl_pkcs12_read($cert_store, $cert_info, "my_secret_pass")) {
echo "Certificate Information\n";
print_r($cert_info);
} else {
echo "Error: Unable to read the cert store.\n";
exit;
}
?>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: