openssl_pkcs12_read
(PHP 5 >= 5.2.2, PHP 7, PHP 8)
openssl_pkcs12_read - PKCS # 12 인증서 저장소를 배열로 구문 분석합니다.
설명
openssl_pkcs12_read(string $pkcs12
, array &$certificates
, string $passphrase
): bool
openssl_pkcs12_read()는 pkcs12
에서 제공하는 PKCS#12 인증서 저장소를 certificates
라는 배열로 구문 분석합니다.
매개변수
pkcs12
- 파일 이름이 아닌 인증서 저장소 내용입니다.
certificates
- 성공하면 인증서 저장소 데이터가 보관됩니다.
passphrase
- PKCS#12 파일의 잠금을 해제하기 위한 암호화 암호입니다.
반환 값
성공하면 true
를, 실패하면 false
를 반환합니다.
Examples
예제 #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;
}
?>