1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
<!-- 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 <gcrypt.h>
</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 );
-->
|