File: armor.h

package info (click to toggle)
onak 0.3.6-2
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,088 kB
  • ctags: 606
  • sloc: ansic: 8,673; perl: 276; makefile: 131; sh: 36; sql: 21
file content (43 lines) | stat: -rw-r--r-- 1,268 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
 * armor.h - Routines to (de)armor OpenPGP packet streams.
 *
 * Jonathan McDowell <noodles@earth.li>
 *
 * Copyright 2002 Project Purple
 */

#ifndef __ARMOR_H__
#define __ARMOR_H__

#include "keystructs.h"

/**
 *	armor_openpgp_stream - Takes a list of OpenPGP packets and armors it.
 *	@putchar_func: The function to output the next armor character.
 *	@ctx: The context pointer for putchar_func.
 *	@packets: The list of packets to output.
 *
 *	This function ASCII armors a list of OpenPGP packets and outputs it
 *	using putchar_func.
 */
int armor_openpgp_stream(int (*putchar_func)(void *ctx, size_t count,
						unsigned char *c),
				void *ctx,
				struct openpgp_packet_list *packets);

/**
 *	dearmor_openpgp_stream - Reads & decodes an ACSII armored OpenPGP msg.
 *	@getchar_func: The function to get the next character from the stream.
 *	@ctx: The context pointer for getchar_func.
 *	@packets: The list of packets.
 *
 *	This function uses getchar_func to read characters from an ASCII
 *	armored OpenPGP stream and outputs the data as a linked list of
 *	packets.
 */
int dearmor_openpgp_stream(int (*getchar_func)(void *ctx, size_t count,
					unsigned char *c),
				void *ctx,
				struct openpgp_packet_list **packets);

#endif /* __ARMOR_H__ */