openssl_pkcs12_read

(PHP 5 >= 5.2.2, PHP 7)

openssl_pkcs12_read锟斤拷 PKCS#12 证锟斤拷娲拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟�

说锟斤拷

openssl_pkcs12_read ( string $pkcs12 , array &$certs , string $pass ) : bool

openssl_pkcs12_read() 锟斤拷pkcs12锟结供锟斤拷PKCS#12证锟斤拷娲拷锟斤拷锟斤拷锟斤拷锟斤拷锟�certs锟斤拷锟斤拷锟侥憋拷锟斤拷锟叫★拷

锟斤拷锟斤拷

pkcs12

证锟斤拷娲拷锟斤拷荩锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷募锟斤拷锟斤拷锟�

certs

锟缴癸拷锟斤拷锟斤拷锟斤拷锟斤拷证锟斤拷娲拷锟斤拷锟�

pass

锟斤拷锟斤拷锟斤拷锟斤拷 PKCS#12 锟侥硷拷锟侥斤拷锟斤拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟缴癸拷时锟斤拷锟斤拷 TRUE锟斤拷 锟斤拷锟斤拷锟斤拷失锟斤拷时锟斤拷锟斤拷 FALSE锟斤拷

锟斤拷锟斤拷

Example #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;
}
?>