This example will clearsign a given text.
Exemple #1 RNP clearsign example
<?php
// init FFI object
$ffi = rnp_ffi_create('GPG', 'GPG');
// generate RSA key
$key = rnp_op_generate_key($ffi, 'test@example.com', 'RSA');
// sign
$data = "Example text to sign";
$signature = rnp_op_sign_cleartext($ffi, $data, array($key));
echo $signature;
// destroy FFI object
rnp_ffi_destroy($ffi);
?>