openssl_cms_verify

FunctionAdded in PHP 8.0

Verify a CMS signature.

PHP 5
PHP 7
PHP 8.0
Added
PHP 8.1
PHP 8.2-8.3
PHP 8.4
PHP 8.5
PHP 8.6

openssl_cms_verify Function synopsis

openssl_cms_verify(
    string $input_filename,
    int $flags = 0,
    ?string $certificates = null,
    array $ca_info = [],
    ?string $untrusted_certificates_filename = null,
    ?string $content = null,
    ?string $pk7 = null,
    ?string $sigfile = null,
    int $encoding = OPENSSL_ENCODING_SMIME
  ): bool

Parameters

$input_filename

Typestring

The input file.

$flags

OptionalTypeintDefault value0

Flags to pass to cms_verify.

$certificates

OptionalType?stringDefault valuenull

A file with the signer certificate and optionally intermediate certificates.

$ca_info

OptionalTypearrayDefault value[]

An array containing self-signed certificate authority certificates.

$untrusted_certificates_filename

OptionalType?stringDefault valuenull

A file containing additional intermediate certificates.

$content

OptionalType?stringDefault valuenull

A file pointing to the content when signatures are detached.

$pk7

OptionalType?stringDefault valuenull

$sigfile

OptionalType?stringDefault valuenull

A file to save the signature to.

$encoding

OptionalTypeintDefault valueOPENSSL_ENCODING_SMIME

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

Return value

Typebool

Returns true on success, false on failure

Changes to the openssl_cms_verify Function

PHP 8.0

  • Function added

openssl_cms_verify Function Availability

PHP VersionAvailability
PHP 8.6Upcoming Release Yes
PHP 8.5Supported (Latest) Yes
PHP 8.4Supported Yes
PHP 8.3Security-Fixes Only Yes
PHP 8.2Security-Fixes Only Yes
PHP 8.1Unsupported Yes
PHP 8.0Unsupported Yes
PHP 7.4Unsupported No
PHP 7.3Unsupported No
PHP 7.2Unsupported No
PHP 7.1Unsupported No
PHP 7.0Unsupported No
PHP 5.6Unsupported No
PHP 5.5Unsupported No
PHP 5.4Unsupported No
PHP 5.3Unsupported No