Added OpenPGP library to lib/silcpgp
[crypto.git] / lib / silcpgp / silcpgp_i.h
1 /*
2
3   silcpgp_i.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2007 - 2008 Pekka Riikonen
8
9   This program is free software; you can redistribute it and/or modify
10   it under the terms of the GNU General Public License as published by
11   the Free Software Foundation; version 2 of the License.
12
13   This program is distributed in the hope that it will be useful,
14   but WITHOUT ANY WARRANTY; without even the implied warranty of
15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16   GNU General Public License for more details.
17
18 */
19
20 #ifndef SILCPGP_I_H
21 #define SILCPGP_I_H
22
23 #ifndef SILCPGP_H
24 #error "Do not include this header directly"
25 #endif
26
27 /* OpenPGP packet.  Contains the raw data and packet tag. */
28 struct SilcPGPPacketStruct {
29   struct SilcPGPPacketStruct *next;
30   SilcBufferStruct data;
31   SilcUInt8 tag;
32 };
33
34 /* Armoring headers */
35 #define SILC_PGP_ARMOR_MESSAGE   "BEGIN PGP MESSAGE"
36 #define SILC_PGP_ARMOR_PUBKEY    "BEGIN PGP PUBLIC KEY BLOCK"
37 #define SILC_PGP_ARMOR_PRIVKEY   "BEGIN PGP PRIVATE KEY BLOCK"
38 #define SILC_PGP_ARMOR_SIGNATURE "BEGIN PGP SIGNATURE"
39
40 SilcPGPPacket silc_pgp_packet_copy(SilcPGPPacket packet);
41 SilcCipher silc_pgp_cipher_alloc(SilcPGPCipher cipher);
42 int silc_pgp_packet_public_key_decode(unsigned char *key, SilcUInt32 key_len,
43                                       SilcPGPPublicKey pubkey);
44 int silc_pgp_packet_private_key_decode(unsigned char *key, SilcUInt32 key_len,
45                                        const char *passphrase,
46                                        SilcUInt32 passphrase_len,
47                                        SilcPGPPrivateKey privkey);
48 #ifdef SILC_DEBUG
49 const char *silc_pgp_packet_name(SilcPGPPacketTag tag);
50 #endif /* SILC_DEBUG */
51
52 #endif /* SILCPGP_I_H */