openssl_cms_sign Sign a file

发表日期:2021-07-01 08:55:20 | 来源: | | 浏览(527) 分类:OpenSSL 函数

openssl_cms_sign

(PHP 8)

openssl_cms_signSign a file

说明

openssl_cms_sign(
    string $input_filename,
    string $output_filename,
    OpenSSLCertificate|string $certificate,
    OpenSSLAsymmetricKey|OpenSSLCertificate|array|string $private_key,
    array|null $headers,
    int $flags = 0,
    int $encoding = OPENSSL_ENCODING_SMIME,
    string|null $untrusted_certificates_filename = null
): bool

This function signs a file with an X.509 certificate and key.

参数

input_filename

The name of the file to be signed.

output_filename

The name of the file to deposit the results.

certificate

The name of the file containing the signing certificate.

private_key

The name of file containing the key associated with certificate.

headers

An array of headers to be included in S/MIME output.

flags

Flags 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_filename

Intermediate certificates to be included in the signature.

返回值

成功时返回 true, 或者在失败时返回 false

集速网 copyRight © 2015-2022 宁ICP备15000399号-1 宁公网安备 64010402001209号
与其临渊羡鱼,不如退而结网
欢迎转载、分享、引用、推荐、收藏。