W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
(PHP 7 >= 7.2.0, PHP 8)
openssl_pkcs7_read — 將 PKCS7 文件導(dǎo)出為 PEM 格式證書的數(shù)組
openssl_pkcs7_read(string $data, array &$certificates): bool
本函數(shù)還未編寫文檔,僅有參數(shù)列表。
data
想要解析的字符串?dāng)?shù)據(jù)(p7b 格式)。
certificates
PEM 格式證書的數(shù)組,來源于輸入的 p7b 數(shù)據(jù)。
成功時(shí)返回 true, 或者在失敗時(shí)返回 false。
示例 #1 根據(jù) P7B 文件獲取 PEM 數(shù)組
<?php
$file = 'certs.p7b';
$f = file_get_contents($file);
$p7 = array();
$r = openssl_pkcs7_read($f, $p7);
if ($r === false) {
printf("ERROR: %s is not a proper p7b file".PHP_EOL, $file);
for($e = openssl_error_string(), $i = 0; $e; $e = openssl_error_string(), $i++)
printf("SSL l%d: %s".PHP_EOL, $i, $e);
exit(1);
}
print_r($p7);
?>
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: