Merge branch 'topic/mm-fixes' of git://208.110.73.182/silc into silc.1.1.branch
[silc.git] / lib / silccore / silcpubkey.h
1 /*
2
3   silcpubkey.h
4
5   Author: Pekka Riikonen <priikone@silcnet.org>
6
7   Copyright (C) 2005 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 /****h* silccore/SILC Public Key Payload
21  *
22  * DESCRIPTION
23  *
24  * Implementation of the Public Key Payload.  Public Key Payload is used to
25  * deliver different types of public keys and certificates in the SILC
26  * protocol.
27  *
28  ***/
29
30 #ifndef SILCPUBKEY_H
31 #define SILCPUBKEY_H
32
33 /****f* silccore/SilcPubKeyAPI/silc_public_key_payload_encode
34  *
35  * SYNOPSIS
36  *
37  *    SilcBool silc_public_key_payload_encode(SilcPublicKey public_key);
38  *
39  * DESCRIPTION
40  *
41  *    Encodes the Public Key Payload from the public key indicated by
42  *    `public_key'.  Returns the allocated and encoded payload buffer,
43  *    or NULL on error.
44  *
45  ***/
46 SilcBuffer silc_public_key_payload_encode(SilcPublicKey public_key);
47
48 /****f* silccore/SilcPubKeyAPI/silc_public_key_payload_decode
49  *
50  * SYNOPSIS
51  *
52  *    SilcBool silc_public_key_payload_decode(unsigned char *data,
53  *                                            SilcUInt32 data_len,
54  *                                            SilcPublicKey *public_key);
55  *
56  * DESCRIPTION
57  *
58  *    Decodes Public Key Payload from `data' of `data_len' bytes in length
59  *    data buffer into `public_key' pointer.  Returns FALSE if the payload
60  *    cannot be decoded.
61  *
62  ***/
63 SilcBool silc_public_key_payload_decode(unsigned char *data,
64                                         SilcUInt32 data_len,
65                                         SilcPublicKey *public_key);
66
67 #endif /* SILCPUBKEY_H */