Decrypt a CMS message

openssl_cms_decrypt

(PHP 8)

openssl_cms_decryptDecrypt a CMS message

說明

openssl_cms_decrypt(
    string $input_filename,
    string $output_filename,
    OpenSSLCertificate|string $certificate,
    OpenSSLAsymmetricKey|OpenSSLCertificate|array|string|null $private_key = null,
    int $encoding = OPENSSL_ENCODING_SMIME
): bool

Decrypts a CMS message.

參數

input_filename

The name of a file containing encrypted content.

output_filename

The name of the file to deposit the decrypted content.

certificate

The name of the file containing a certificate of the recipient.

private_key

The name of the file containing a PKCS#8 key.

encoding

The encoding of the input file. One of OPENSSL_ENCODING_SMIME, OPENSSL_ENCODING_DER or OPENSSL_ENCODING_PEM.

返回值

成功時返回 true, 或者在失敗時返回 false

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *