php8.5
Home/ Manual/ rnp / functions/ rnp_op_verify

rnp_op_verify

PHP function Edit on GitHub ✎

(PECL rnp >= 0.1.1)

Verify embedded or cleartext signatures

Description

rnp_op_verify(RnpFFI $ffi, string $data): array|false

Parameters

ffi

Ffi-description

data

Signed data.

Return Values

An associative array with information about verification resultsFalseforfailure.

KeyData typeDescription
"verification_status"stringOverall verification result, either "Success" string or appropriate error message. "Success" result is set when at least one signature is valid and successfully verified. Individual verification results for each signature can be checked in the "signatures" array.
"file_name"stringFile name.
"file_mtime"integerFile modification time.
"mode"stringData protection (encryption) mode used in processed message. Currently defined values are "none", "cfb", "cfb-mdc", "aead-ocb", "aead-eax".
"cipher"stringSymmetric cipher used for data encryption.
"valid_integrity"booleantrue if message integrity protection was used (i.e. MDC or AEAD) and it was validated successfully.
"signatures"arrayAn associative array describing each signature found. See description below.

"signatures" sub-array.

KeyData typeDescription
"verification_status"stringSignature verification status, either "Success" string or appropriate error message.
"creation_time"integerSignature creation time in seconds since Jan, 1 1970 UTC.
"expiration_time"integerSignature expiration time in seconds since the creation time or 0 if signature never expires.
"hash"stringHash function algorithm used to calculate the signature.
"signing_key"stringFingerprint of the key used for signing. Could be "Not found" if corresponding public key is not loaded to the FFI object.
"signature_type"stringSignature type. Currently defined values are: 'binary', 'text', 'standalone', 'certification (generic)', 'certification (persona)', 'certification (casual)', 'certification (positive)', 'subkey binding', 'primary key binding', 'direct', 'key revocation', 'subkey revocation', 'certification revocation', 'timestamp', 'uknown: 0..255'.

Source: reference/rnp/functions/rnp-op-verify.xml · from the official PHP manual (php/doc-en)