PHP - Manual: openssl_cms_verify
2024-12-22
(PHP 8)
openssl_cms_verify — Verify a CMS signature
$input_filename
,$flags
= 0,$certificates
= null
,$ca_info
= [],$untrusted_certificates_filename
= null
,$content
= null
,$pk7
= null
,$sigfile
= null
,$encoding
= OPENSSL_ENCODING_SMIME
This function verifies a CMS signature, either attached or detached, with the specified encoding.
input_filename
The input file.
flags
Flags to pass to cms_verify().
certificates
A file with the signer certificate and optionally intermediate certificates.
ca_info
An array containing self-signed certificate authority certificates.
untrusted_certificates_filename
A file containing additional intermediate certificates.
content
A file pointing to the content when signatures are detached.
pk7
sigfile
A file to save the signature to.
encoding
The encoding of the input file. One of OPENSSL_ENCODING_SMIME
,
OPENSSL_ENCODING_DER
or OPENSSL_ENCODING_PEM
.
成功时返回 true
, 或者在失败时返回 false
。
官方地址:https://www.php.net/manual/en/function.openssl-cms-verify.php