(PHP 8)
openssl_cms_sign — Sign a file
$input_filename,$output_filename,$certificate,$private_key,$headers,$flags = 0,$encoding = OPENSSL_ENCODING_SMIME,$untrusted_certificates_filename = nullThis function signs a file with an X.509 certificate and key.
input_filenameThe name of the file to be signed.
output_filenameThe name of the file to deposit the results.
certificateThe name of the file containing the signing certificate.
private_key
The name of file containing the key associated with certificate.
headersAn array of headers to be included in S/MIME output.
flagsFlags to be passed to cms_sign().
encoding
The encoding of the output file. One of OPENSSL_CMS_SMIME,
OPENSLL_CMS_DER or OPENSSL_CMS_PEM.
untrusted_certificates_filenameIntermediate certificates to be included in the signature.
成功时返回 true, 或者在失败时返回 false。