Files
php-doc-ru/reference/rnp/examples.xml
2022-11-01 15:42:21 +03:00

56 lines
1.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 79bc1248b2295d9c9f0837d1ddcaea9d7c2853a7 Maintainer: sergey Status: ready -->
<!-- Reviewed: no -->
<chapter xml:id="rnp.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<section xml:id="rnp.examples-clearsign">
<title>Подписание текста</title>
<para>
В данном примере будет подписание заданного текста.
</para>
<example>
<title>Пример расчёта RNP</title>
<programlisting role="php">
<![CDATA[
<?php
// Инициализация объекта FFI
$ffi = rnp_ffi_create('GPG', 'GPG');
// Генерация ключа RSA
$key = rnp_op_generate_key($ffi, 'test@example.com', 'RSA');
// Подписание
$data = "Пример текста для подписи";
$signature = rnp_op_sign_cleartext($ffi, $data, array($key));
echo $signature;
// Уничтожение объекта FFI
rnp_ffi_destroy($ffi);
?>
]]>
</programlisting>
</example>
</section>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->