~ubuntu-branches/ubuntu/karmic/gnupg2/karmic-updates

« back to all changes in this revision

Viewing changes to doc/gcryptref-misc.sgml

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2006-01-24 04:31:42 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060124043142-pbg192or6qxv3yk2
Tags: 1.9.20-1
* New Upstream version. Closes:#306890,#344530
  * Closes:#320490: gpg-protect-tool fails to decrypt PKCS-12 files 
* Depend on libopensc2-dev, not -1-. Closes:#348106

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!-- gcryptref-digest.sgml - libgcrypt reference (digests)
 
2
    Copyright (C) 2000 Free Software Foundation, Inc.
 
3
 
 
4
    This file is part of GnuPG.
 
5
 
 
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.
 
10
 
 
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.
 
15
 
 
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
 
19
-->
 
20
 
 
21
<refentry>
 
22
  <refnamediv>
 
23
    <refname>gcry_check_version</refname>
 
24
    <refpurpose>get or check the version of libgcrypt</refpurpose>
 
25
  </refnamediv>
 
26
 
 
27
  <refsynopsisdiv>
 
28
    <funcsynopsis>
 
29
      <funcsynopsisinfo>
 
30
      #include &lt;gcrypt.h&gt;
 
31
      </funcsynopsisinfo>
 
32
      <funcprototype>
 
33
        <funcdef>const char *<function>gcry_check_version</function></funcdef>
 
34
        <paramdef>const char *<parameter>req_version</parameter></paramdef>
 
35
      </funcprototype>
 
36
    </funcsynopsis>
 
37
  </refsynopsisdiv>
 
38
 
 
39
  <refsect1><title>Description</title>
 
40
  <para>
 
41
  <indexterm><primary>gcry_check_version</primary>
 
42
             </indexterm>
 
43
  <function>gcry_check_version</function> checks
 
44
that the version of the library is at minimum the requested one
 
45
and return the version string; NULL is returned if the condition is
 
46
not met.  You may pass NULL as reqy_version to simply get the version
 
47
string back without any checking.
 
48
  </para>
 
49
</refentry>
 
50
 
 
51
<refentry>
 
52
  <refnamediv>
 
53
    <refname>gcry_errno</refname>
 
54
    <refname>gcry_strerror</refname>
 
55
    <refpurpose>Get the last error</refpurpose>
 
56
  </refnamediv>
 
57
 
 
58
  <refsynopsisdiv>
 
59
    <funcsynopsis>
 
60
      <funcsynopsisinfo>
 
61
      #include &lt;gcrypt.h&gt;
 
62
      </funcsynopsisinfo>
 
63
      <funcprototype>
 
64
        <funcdef>int <function>gcry_errno</function></funcdef>
 
65
      </funcprototype>
 
66
      <funcprototype>
 
67
        <funcdef>const char *<function>gcry_strerror</function></funcdef>
 
68
        <paramdef>int<parameter>no</parameter></paramdef>
 
69
      </funcprototype>
 
70
    </funcsynopsis>
 
71
  </refsynopsisdiv>
 
72
 
 
73
  <refsect1><title>Description</title>
 
74
  <para>
 
75
  <indexterm><primary>gcry_errno</primary></indexterm>
 
76
  <indexterm><primary>gcry_strerror</primary></indexterm>
 
77
  Both function are to be used like there Standard-C
 
78
  counterparts.  However <function>gcry_errno</function> is a function
 
79
  and not just a global variable.  If -1 is passed to
 
80
  <function>gcry_strerror</>, <function>gcry_errno</> is implictly used.
 
81
  </para>
 
82
</refentry>
 
83
 
 
84
 
 
85
<refentry>
 
86
  <refnamediv>
 
87
    <refname>gcry_control</refname>
 
88
        <refpurpose>Multi purpose control function</refpurpose>
 
89
  </refnamediv>
 
90
 
 
91
  <refsynopsisdiv>
 
92
    <funcsynopsis>
 
93
      <funcsynopsisinfo>
 
94
      #include &lt;gcrypt.h&gt;
 
95
      </funcsynopsisinfo>
 
96
      <funcprototype>
 
97
        <funcdef>int <function>gcry_control</function></funcdef>
 
98
        <paramdef>enum gcry_ctl_cmds<parameter>cmd</parameter></paramdef>
 
99
        <paramdef><parameter>...</parameter></paramdef>
 
100
      </funcprototype>
 
101
    </funcsynopsis>
 
102
  </refsynopsisdiv>
 
103
 
 
104
  <refsect1><title>Description</title>
 
105
  <para>
 
106
  <indexterm><primary>gcry_control</primary></indexterm>
 
107
  This function is used to control various aspects of &libgcrypt;
 
108
  FIXME: Explain all commands here.
 
109
  </para>
 
110
</refentry>
 
111
 
 
112
 
 
113
 
 
114
 
 
115
 
 
116
<refentry>
 
117
  <refnamediv>
 
118
    <refname>gcry_set_allocation_handler</refname>
 
119
    <refname>gcry_set_outofcore_handler</refname>
 
120
        <refpurpose>Use application defined malloc functions</refpurpose>
 
121
  </refnamediv>
 
122
 
 
123
  <refsynopsisdiv>
 
124
    <funcsynopsis>
 
125
      <funcsynopsisinfo>
 
126
      #include &lt;gcrypt.h&gt;
 
127
      </funcsynopsisinfo>
 
128
      <funcprototype>
 
129
        <funcdef>void <function>gcry_set_allocation_handler</></funcdef>
 
130
        <paramdef>void *(*<parameter>alloc_func</>)(size_t n)</paramdef>
 
131
        <paramdef>void *(*<parameter>alloc_secure_func</>)(size_t n)</paramdef>
 
132
        <paramdef>int (*<parameter>is_secure_func</>)(const void *p)</paramdef>
 
133
        <paramdef>void *(*<parameter>realloc_func</>)(void *p, size_t n)</paramdef>
 
134
        <paramdef>void (*<parameter>free_func</>)(void *p)</paramdef>
 
135
      </funcprototype>
 
136
      <funcprototype>
 
137
        <funcdef>void <function>gcry_set_outofcore_handler</></funcdef>
 
138
 
 
139
        <paramdef>int (*<parameter>h</>)( void*, size_t, unsigned int ),
 
140
                                        void *opaque )</paramdef>
 
141
      </funcprototype>
 
142
    </funcsynopsis>
 
143
  </refsynopsisdiv>
 
144
 
 
145
  <refsect1><title>Description</title>
 
146
  <para>
 
147
  <indexterm><primary>gcry_set_allocation_handler</primary></indexterm>
 
148
  <indexterm><primary>gcry_set_outofcore_handler</primary></indexterm>
 
149
 
 
150
  FIXME
 
151
  </para>
 
152
</refentry>
 
153
 
 
154
 
 
155
<refentry>
 
156
  <refnamediv>
 
157
    <refname>gcry_set_fatalerror_handler</refname>
 
158
        <refpurpose>change the default fatal error handler</refpurpose>
 
159
  </refnamediv>
 
160
 
 
161
  <refsynopsisdiv>
 
162
    <funcsynopsis>
 
163
      <funcsynopsisinfo>
 
164
      #include &lt;gcrypt.h&gt;
 
165
      </funcsynopsisinfo>
 
166
      <funcprototype>
 
167
        <funcdef>void <function>gcry_set_fatalerror_handler</></funcdef>
 
168
        <paramdef>void (*<parameter>func</>)(
 
169
             void *, int, const char*)</paramdef>
 
170
        <paramdef>void *<parameter>opaque</></paramdef>
 
171
      </funcprototype>
 
172
    </funcsynopsis>
 
173
  </refsynopsisdiv>
 
174
 
 
175
  <refsect1><title>Description</title>
 
176
  <para>
 
177
  <indexterm><primary>gcry_set_fatalerror_handler</primary></indexterm>
 
178
  At certain places the &libgcrypt; may need to call a fatal error fucntion
 
179
  which does terminate the process.  To allow an application to do
 
180
  some emergency cleanup, it may register a fatal error handler with
 
181
  the library.  This handler is assumed to terminate the application;
 
182
  however if it returns &libgcrypt; will abort anyway.
 
183
     </para>
 
184
  <para>
 
185
The handler is called with the opaque value registered here, an
 
186
errorcode from &libgcrypt; and some descriptive text string.
 
187
  </para>
 
188
</refentry>
 
189
 
 
190
 
 
191
<refentry>
 
192
  <refnamediv>
 
193
    <refname>gcry_set_gettext_handler</refname>
 
194
        <refpurpose>Change the default gettext function</refpurpose>
 
195
  </refnamediv>
 
196
 
 
197
  <refsynopsisdiv>
 
198
    <funcsynopsis>
 
199
      <funcsynopsisinfo>
 
200
      #include &lt;gcrypt.h&gt;
 
201
      </funcsynopsisinfo>
 
202
      <funcprototype>
 
203
        <funcdef>void <function>gcry_set_gettext_handler</></funcdef>
 
204
        <paramdef>const char *(*<parameter>func</>)(const char*)</paramdef>
 
205
        <paramdef>void *<parameter>opaque</></paramdef>
 
206
      </funcprototype>
 
207
    </funcsynopsis>
 
208
  </refsynopsisdiv>
 
209
 
 
210
  <refsect1><title>Description</title>
 
211
  <para>
 
212
  <indexterm><primary>gcry_set_log_handler</primary></indexterm>
 
213
  FIXME!!
 
214
  </para>
 
215
</refentry>
 
216
 
 
217
 
 
218
 
 
219
 
 
220
void gcry_set_log_handler( void (*f)(void*,int, const char*, va_list ),
 
221
                                                             void *opaque );
 
222
<refentry>
 
223
  <refnamediv>
 
224
    <refname>gcry_set_log_handler</refname>
 
225
        <refpurpose>Change the default logging function</refpurpose>
 
226
  </refnamediv>
 
227
 
 
228
  <refsynopsisdiv>
 
229
    <funcsynopsis>
 
230
      <funcsynopsisinfo>
 
231
      #include &lt;gcrypt.h&gt;
 
232
      </funcsynopsisinfo>
 
233
      <funcprototype>
 
234
        <funcdef>void <function>gcry_set_log_handler</></funcdef>
 
235
        <paramdef>void (*<parameter>func</>)
 
236
         (void*, int, const char*, va_list)</paramdef>
 
237
        <paramdef>void *<parameter>opaque</></paramdef>
 
238
      </funcprototype>
 
239
    </funcsynopsis>
 
240
  </refsynopsisdiv>
 
241
 
 
242
  <refsect1><title>Description</title>
 
243
  <para>
 
244
  <indexterm><primary>gcry_set_log_handler</primary></indexterm>
 
245
  &libgcrypt; has it;s own logging functions.  Applications which 
 
246
  need to use their own, should provide a log function to &libgcrypt;
 
247
so that it will use this function instead.
 
248
 
 
249
Fixme: Describe how this is intended to work.
 
250
  </para>
 
251
</refentry>
 
252
 
 
253
 
 
254
void *gcry_malloc( size_t n );
 
255
void *gcry_calloc( size_t n, size_t m );
 
256
void *gcry_malloc_secure( size_t n );
 
257
void *gcry_calloc_secure( size_t n, size_t m );
 
258
void *gcry_realloc( void *a, size_t n );
 
259
void *gcry_xmalloc( size_t n );
 
260
void *gcry_xcalloc( size_t n, size_t m );
 
261
void *gcry_xmalloc_secure( size_t n );
 
262
void *gcry_xcalloc_secure( size_t n, size_t m );
 
263
void *gcry_xrealloc( void *a, size_t n );
 
264
char *gcry_xstrdup( const char * a);
 
265
void  gcry_free( void *a );
 
266
int   gcry_is_secure( const void *a );
 
267
 
 
268
<refentry>
 
269
  <refnamediv>
 
270
    <refname>gcry_malloc</refname>
 
271
    <refname>gcry_calloc</refname>
 
272
    <refname>gcry_malloc_secure</refname>
 
273
    <refname>gcry_calloc_secure</refname>
 
274
    <refname>gcry_realloc</refname>
 
275
    <refname>gcry_xmalloc</refname>
 
276
    <refname>gcry_xcalloc</refname>
 
277
    <refname>gcry_xmalloc_secure</refname>
 
278
    <refname>gcry_xcalloc_secure</refname>
 
279
    <refname>gcry_xrealloc</refname>
 
280
    <refname>gcry_xstrdup</refname>
 
281
 
 
282
  WORk WORK
 
283
    <refname>gcry_malloc</refname>
 
284
    <refname>gcry_malloc</refname>
 
285
    
 
286
        <refpurpose>Change the default logging function</refpurpose>
 
287
  </refnamediv>
 
288
 
 
289
  <refsynopsisdiv>
 
290
    <funcsynopsis>
 
291
      <funcsynopsisinfo>
 
292
      #include &lt;gcrypt.h&gt;
 
293
      </funcsynopsisinfo>
 
294
      <funcprototype>
 
295
        <funcdef>void <function>gcry_set_log_handler</></funcdef>
 
296
        <paramdef>void (*<parameter>func</>)
 
297
         (void*, int, const char*, va_list)</paramdef>
 
298
        <paramdef>void *<parameter>opaque</></paramdef>
 
299
      </funcprototype>
 
300
    </funcsynopsis>
 
301
  </refsynopsisdiv>
 
302
 
 
303
  <refsect1><title>Description</title>
 
304
  <para>
 
305
  <indexterm><primary>gcry_set_log_handler</primary></indexterm>
 
306
  &libgcrypt; has it;s own logging functions.  Applications which 
 
307
  need to use their own, should provide a log function to &libgcrypt;
 
308
so that it will use this function instead.
 
309
 
 
310
Fixme: Describe how this is intended to work.
 
311
  </para>
 
312
</refentry>
 
313
 
 
314
 
 
315
 
 
316
void gcry_randomize( byte *buffer, size_t length,
 
317
                     enum gcry_random_level level );
 
318
void *gcry_random_bytes( size_t nbytes, enum gcry_random_level level );
 
319
void *gcry_random_bytes_secure( size_t nbytes, enum gcry_random_level level );
 
320
 
 
321
 
 
322
 
 
323
    -->
 
324
 
 
325
 
 
326