openssl_pkcs7_verify

(PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8)

openssl_pkcs7_verify - S/MIME 서명된 메시지의 서명을 확인합니다.


설명

openssl_pkcs7_verify(
    string $input_filename,
    int $flags,
    ?string $signers_certificates_filename = null,
    array $ca_info = [],
    ?string $untrusted_certificates_filename = null,
    ?string $content = null,
    ?string $output_filename = null
): bool|int
                

openssl_pkcs7_verify()는 주어진 파일에 포함된 S/MIME 메시지를 읽고 디지털 서명을 검사합니다.


매개변수

input_filename
메시지의 경로입니다.
flags
flags를 사용하여 서명 확인 방법에 영향을 줄 수 있습니다. 자세한 내용은 PKCS7 constants를 참조하세요.
signers_certificates_filename
signers_certificates_filename이 지정되면 메시지에 서명한 사람의 인증서가 PEM 형식으로 저장될 파일 이름을 포함하는 문자열이어야 합니다.
ca_info
ca_info가 지정된 경우 확인 프로세스에서 사용할 신뢰할 수 있는 CA 인증서에 대한 정보를 보유해야 합니다. 이 매개변수에 대한 자세한 내용은 certificate verification을 참조하십시오.
untrusted_certificates_filename
untrusted_certificates_filename이 지정되면 신뢰할 수 없는 CA로 사용할 여러 인증서가 포함된 파일의 파일 이름입니다.
content
확인된 데이터로 채워지지만 서명 정보는 제거된 content으로 파일 이름을 지정할 수 있습니다.
output_filename

반환 값

서명이 확인된 경우 true를 반환하고, 서명이 올바르지 않은 경우(메시지가 변조되었거나 서명 인증서가 유효하지 않은 경우) false를 반환하고, 오류가 발생하면 -1을 반환합니다.


변경 로그

버전 설명
8.0.0 이제 signers_certificates_filename, untrusted_certificates_filename, contentoutput_filename이 null을 허용합니다.
7.2.0 output_filename 매개변수가 추가되었습니다.

노트

참고: RFC 2045에 지정된 대로 input_filename 매개변수의 행은 76자를 초과할 수 없습니다.