cscvs to tla changeset 77
[onak.git] / armor.h
1 /*
2  * armor.h - Routines to (de)armor OpenPGP packet streams.
3  *
4  * Jonathan McDowell <noodles@earth.li>
5  *
6  * Copyright 2002 Project Purple
7  *
8  * $Id: armor.h,v 1.4 2003/06/04 20:57:07 noodles Exp $
9  */
10
11 #ifndef __ARMOR_H__
12 #define __ARMOR_H__
13
14 #include "keystructs.h"
15
16 /**
17  *      armor_openpgp_stream - Takes a list of OpenPGP packets and armors it.
18  *      @putchar_func: The function to output the next armor character.
19  *      @ctx: The context pointer for putchar_func.
20  *      @packets: The list of packets to output.
21  *
22  *      This function ASCII armors a list of OpenPGP packets and outputs it
23  *      using putchar_func.
24  */
25 int armor_openpgp_stream(int (*putchar_func)(void *ctx, size_t count,
26                                                 unsigned char *c),
27                                 void *ctx,
28                                 struct openpgp_packet_list *packets);
29
30 /**
31  *      dearmor_openpgp_stream - Reads & decodes an ACSII armored OpenPGP msg.
32  *      @getchar_func: The function to get the next character from the stream.
33  *      @ctx: The context pointer for getchar_func.
34  *      @packets: The list of packets.
35  *
36  *      This function uses getchar_func to read characters from an ASCII
37  *      armored OpenPGP stream and outputs the data as a linked list of
38  *      packets.
39  */
40 int dearmor_openpgp_stream(int (*getchar_func)(void *ctx, size_t count,
41                                         unsigned char *c),
42                                 void *ctx,
43                                 struct openpgp_packet_list **packets);
44
45 #endif /* __ARMOR_H__ */