1
0
mirror of https://github.com/php/doc-ru.git synced 2026-03-24 07:42:22 +01:00
Files
archived-doc-ru/reference/rnp/examples.xml
2026-01-25 16:13:25 +00:00

56 lines
1.5 KiB
XML
Raw Permalink 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: 462b2bc5580f4bfaabe48be54a91f978cc181e9b Maintainer: sergey Status: ready -->
<!-- Reviewed: no -->
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="rnp.examples">
&reftitle.examples;
<section xml:id="rnp.examples-clearsign">
<title>Подписание текста</title>
<simpara>
В данном примере будет подписание заданного текста.
</simpara>
<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
-->