Clearsign text

This example will clearsign a given text.

Example #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);
?>
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top