1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-14 00:19:50 +02:00
gnupg/doc/gcryptref-pubkey.sgml
2000-02-08 17:12:00 +00:00

93 lines
3.1 KiB
Plaintext

<!-- gcryptref-digest.sgml - libgcrypt reference (digests)
Copyright (C) 2000 Free Software Foundation, Inc.
This file is part of GnuPG.
GnuPG is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GnuPG is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-->
<!--**********************************************
*********** pk_encrypt *************************
***********************************************-->
<refentry>
<refnamediv>
<refname>gcry_pk_encrypt</refname>
<refpurpose>do a public key encryption</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcsynopsisinfo>
#include &lt;gcrypt.h&gt;
</funcsynopsisinfo>
<funcprototype>
<funcdef>int <function>gcry_pk_encrypt</function></funcdef>
<paramdef>GCRY_SEXP *<parameter>result</parameter></paramdef>
<paramdef>GCRY_SEXP <parameter>data</parameter></paramdef>
<paramdef>GCRY_SEXP <parameter>pkey</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1><title>Description</title>
<para>
<indexterm><primary>public key functions</primary>
<secondary>gcry_pk_encrypt</secondary>
</indexterm>
<function>gcry_pk_encrypt</function> performs public key encryption
operations. The caller has to provide a public key as the &sexp;
<parameter>pkey</> and <parameter>data</> as a &sexp;
with just one MPI in it. The function returns a &sexp; which may
be passed tp to pk_decrypt.
Later versions of this functions may take more complex input data.
Returns: 0 or an errorcode.
</para>
<literallayout>
s_data = (<replaceable/mpi/)
s_pkey = <replaceable/key-as-defined-in-sexp_to_key/
r_ciph = (enc-val
(<replaceable/algo/
(<replaceable/param_name1/ <replaceable/mpi/)
...
(<replaceable/param_namen/ <replaceable/mpi/)
))
</literallayout>
</refentry>
<!--
int gcry_pk_decrypt( GCRY_SEXP *result, GCRY_SEXP data, GCRY_SEXP skey );
int gcry_pk_sign( GCRY_SEXP *result, GCRY_SEXP data, GCRY_SEXP skey );
int gcry_pk_verify( GCRY_SEXP sigval, GCRY_SEXP data, GCRY_SEXP pkey );
int gcry_pk_testkey( GCRY_SEXP key );
int gcry_pk_genkey( GCRY_SEXP *r_key, GCRY_SEXP s_parms );
int gcry_pk_ctl( int cmd, void *buffer, size_t buflen);
int gcry_pk_algo_info( int algo, int what, void *buffer, size_t *nbytes);
#define gcry_pk_test_algo(a) \
gcry_pk_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL )
const char *gcry_pk_algo_name( int algo );
int gcry_pk_map_name( const char* name );
unsigned int gcry_pk_get_nbits( GCRY_SEXP key );
-->