1
<!-- gcryptref-digest.sgml - libgcrypt reference (digests)
2
Copyright (C) 2000 Free Software Foundation, Inc.
4
This file is part of GnuPG.
6
GnuPG is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
GnuPG is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22
<!--**********************************************
23
*********** pk_encrypt *************************
24
***********************************************-->
27
<refname>gcry_pk_encrypt</refname>
28
<refpurpose>do a public key encryption</refpurpose>
34
#include <gcrypt.h>
37
<funcdef>int <function>gcry_pk_encrypt</function></funcdef>
38
<paramdef>GCRY_SEXP *<parameter>result</parameter></paramdef>
39
<paramdef>GCRY_SEXP <parameter>data</parameter></paramdef>
40
<paramdef>GCRY_SEXP <parameter>pkey</parameter></paramdef>
46
<refsect1><title>Description</title>
48
<indexterm><primary>public key functions</primary>
49
<secondary>gcry_pk_encrypt</secondary>
51
<function>gcry_pk_encrypt</function> performs public key encryption
52
operations. The caller has to provide a public key as the &sexp;
53
<parameter>pkey</> and <parameter>data</> as a &sexp;
54
with just one MPI in it. The function returns a &sexp; which may
55
be passed tp to pk_decrypt.
56
Later versions of this functions may take more complex input data.
58
Returns: 0 or an errorcode.
61
s_data = (<replaceable/mpi/)
62
s_pkey = <replaceable/key-as-defined-in-sexp_to_key/
65
(<replaceable/param_name1/ <replaceable/mpi/)
67
(<replaceable/param_namen/ <replaceable/mpi/)
74
int gcry_pk_decrypt( GCRY_SEXP *result, GCRY_SEXP data, GCRY_SEXP skey );
78
int gcry_pk_sign( GCRY_SEXP *result, GCRY_SEXP data, GCRY_SEXP skey );
79
int gcry_pk_verify( GCRY_SEXP sigval, GCRY_SEXP data, GCRY_SEXP pkey );
80
int gcry_pk_testkey( GCRY_SEXP key );
81
int gcry_pk_genkey( GCRY_SEXP *r_key, GCRY_SEXP s_parms );
83
int gcry_pk_ctl( int cmd, void *buffer, size_t buflen);
84
int gcry_pk_algo_info( int algo, int what, void *buffer, size_t *nbytes);
85
#define gcry_pk_test_algo(a) \
86
gcry_pk_algo_info( (a), GCRYCTL_TEST_ALGO, NULL, NULL )
88
const char *gcry_pk_algo_name( int algo );
89
int gcry_pk_map_name( const char* name );
90
unsigned int gcry_pk_get_nbits( GCRY_SEXP key );