rnp_op_sign

(PECL rnp >= 0.1.1)

rnp_op_signPerform signing operation on a binary data, return embedded signature(s)

Description

rnp_op_sign(
    RnpFFI$ffi,
    string$data,
    array$keys_fp,
    array$options = ?
): string|false

Parameters

ffi

The FFI object returned by rnp_ffi_create.

data

Data to be signed.

keys_fp

Array with key fingerprints. At least one key must be provided. Keys should be present in ffi.

options

An associative array with options.

KeyData typeDescription
"compression_alg"stringCompression algorithm. Both "compression_alg" and "compression_level" must be set in order to enable data compression.
"compression_level"integerCompression level, 0-9. 0 disables compression.
"armor"booleanEnable ASCII-armored output. Disabled by default.
"hash"stringSet hash algorithm used during signature calculation.
"creation_time"integerSet signature creation time in seconds since Jan, 1 1970 UTC. By default current time is used.
"expiration_time"integerSet signature expiration time in seconds since the creation time. 0 value is used to mark signature as non-expiring (default value).
"file_name"stringSet input file name.Special value _CONSOLE may be used to mark message as 'for your eyes only', i.e. it should not be stored anywhere but only displayed to the receiver. Default is the empty string.
"file_mtime"integerSet input file modification date in seconds since Jan, 1 1970 UTC.

Return Values

Data with embedded signature(s) on success or false on failure.

To Top