openssl_cms_encrypt
(PHP 8)
openssl_cms_encrypt — Encrypt a CMS message
说明
string
$input_filename,string
$output_filename,OpenSSLCertificate|array|string
$certificate,?array
$headers,int
$flags = 0,int
$encoding = OPENSSL_ENCODING_SMIME,string|int
$cipher_algo = OPENSSL_CIPHER_AES_128_CBC): bool
This function encrypts content to one or more recipients, based on the certificates that are passed to it.
参数
input_filename
The file to be encrypted.
output_filename
The output file.
certificate
Recipients to encrypt to.
headers
Headers to include when S/MIME is used.
flags
Flags to be passed to CMS_sign.
encoding
An encoding to output. One of OPENSSL_ENCODING_SMIME,
OPENSSL_ENCODING_DER or OPENSSL_ENCODING_PEM.
cipher_algo
A cipher to use.
更新日志
| 版本 | 说明 |
|---|---|
| 8.5.0 |
cipher_algo is now of type int or string.
Previously, it was of type int.
|
| 8.1.0 |
The default cipher algorithm (cipher_algo) is now
AES-128-CBC (OPENSSL_CIPHER_AES_128_CBC). Previously,
PKCS7/CMS was used (OPENSSL_CIPHER_RC2_40).
|
来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。
