]> the.earth.li Git - onak.git/blob - armor.h
cscvs to tla changeset 2
[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
9 #ifndef __ARMOR_H__
10 #define __ARMOR_H__
11
12 #include "keystructs.h"
13
14 /**
15  *      armor_openpgp_stream - Takes a list of OpenPGP packets and armors it.
16  *      @putchar_func: The function to output the next armor character.
17  *      @ctx: The context pointer for putchar_func.
18  *      @packets: The list of packets to output.
19  *
20  *      This function ASCII armors a list of OpenPGP packets and outputs it
21  *      using putchar_func.
22  */
23 int armor_openpgp_stream(int (*putchar_func)(void *ctx, unsigned char c),
24                                 void *ctx,
25                                 struct openpgp_packet_list *packets);
26
27 /**
28  *      dearmor_openpgp_stream - Reads & decodes an ACSII armored OpenPGP msg.
29  *      @getchar_func: The function to get the next character from the stream.
30  *      @ctx: The context pointer for getchar_func.
31  *      @packets: The list of packets.
32  *
33  *      This function uses getchar_func to read characters from an ASCII
34  *      armored OpenPGP stream and outputs the data as a linked list of
35  *      packets.
36  */
37 int dearmor_openpgp_stream(int (*getchar_func)(void *ctx, size_t count,
38                                         unsigned char *c),
39                                 void *ctx,
40                                 struct openpgp_packet_list **packets);
41
42 #endif /* __ARMOR_H__ */