Update Debian Vcs-* fields to point to git repository
[onak.git] / armor.h
1 /**
2  * @file armor.h
3  * @brief Routines to (de)armor OpenPGP packet streams.
4  *
5  * Copyright 2002-2004, 2011 Jonathan McDowell <noodles@earth.li>
6  *
7  * This program is free software: you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation; version 2 of the License.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14  * more details.
15  *
16  * You should have received a copy of the GNU General Public License along with
17  * this program; if not, write to the Free Software Foundation, Inc., 51
18  * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20
21 #ifndef __ARMOR_H__
22 #define __ARMOR_H__
23
24 #include "keystructs.h"
25
26 /**
27  * @brief Takes a list of OpenPGP packets and armors it.
28  * @param putchar_func The function to output the next armor character.
29  * @param ctx The context pointer for putchar_func.
30  * @param packets The list of packets to output.
31  *
32  * This function ASCII armors a list of OpenPGP packets and outputs it
33  * using putchar_func.
34  */
35 int armor_openpgp_stream(int (*putchar_func)(void *ctx, size_t count,
36                                                 void *c),
37                                 void *ctx,
38                                 struct openpgp_packet_list *packets);
39
40 /**
41  * @brief Reads & decodes an ACSII armored OpenPGP msg.
42  * @param getchar_func The function to get the next character from the stream.
43  * @param ctx The context pointer for getchar_func.
44  * @param packets The list of packets.
45  *
46  * This function uses getchar_func to read characters from an ASCII
47  * armored OpenPGP stream and outputs the data as a linked list of
48  * packets.
49  */
50 int dearmor_openpgp_stream(int (*getchar_func)(void *ctx, size_t count,
51                                         void *c),
52                                 void *ctx,
53                                 struct openpgp_packet_list **packets);
54
55 #endif /* __ARMOR_H__ */