]> git.ipfire.org Git - thirdparty/strongswan.git/blob - programs/pluto/pgp.h
- import of strongswan-2.7.0
[thirdparty/strongswan.git] / programs / pluto / pgp.h
1 /* Support of OpenPGP certificates
2 * Copyright (C) 2002-2004 Andreas Steffen, Zuercher Hochschule Winterthur
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * RCSID $Id: pgp.h,v 1.3 2005/08/07 07:50:09 as Exp $
15 */
16
17 #ifndef _PGP_H
18 #define _PGP_H
19
20 #include "pkcs1.h"
21 /*
22 * Length of PGP V3 fingerprint
23 */
24 #define PGP_FINGERPRINT_SIZE MD5_DIGEST_SIZE
25
26 typedef char fingerprint_t[PGP_FINGERPRINT_SIZE];
27
28 /* access structure for an OpenPGP certificate */
29
30 typedef struct pgpcert pgpcert_t;
31
32 struct pgpcert {
33 pgpcert_t *next;
34 time_t installed;
35 int count;
36 chunk_t certificate;
37 time_t created;
38 time_t until;
39 enum pubkey_alg pubkeyAlg;
40 chunk_t modulus;
41 chunk_t publicExponent;
42 fingerprint_t fingerprint;
43 };
44
45 extern const pgpcert_t empty_pgpcert;
46 extern bool parse_pgp(chunk_t blob, pgpcert_t *cert, RSA_private_key_t *key);
47 extern void share_pgpcert(pgpcert_t *cert);
48 extern void select_pgpcert_id(pgpcert_t *cert, struct id *end_id);
49 extern pgpcert_t* add_pgpcert(pgpcert_t *cert);
50 extern void list_pgp_end_certs(bool utc);
51 extern void release_pgpcert(pgpcert_t *cert);
52 extern void free_pgpcert(pgpcert_t *cert);
53
54 #endif /* _PGP_H */