OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / pluto / pkcs.h
1 /* Support of PKCS#1 and PKCS#7 data structures
2  * Copyright (C) 2002 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: pkcs.h,v 0.1 2002/04/12 00:00:00 as Exp $
15  */
16
17 /* path definition for my private keys */
18
19 #include <config/autoconf.h>
20
21 #ifdef CONFIG_USER_FLATFSD_FLATFSD
22 #define PRIVATE_KEY_PATH  "/etc/config"
23 #else
24 #define PRIVATE_KEY_PATH  "/etc"
25 #endif
26
27 /* access structure for a PKCS#1 private key */
28
29 typedef struct pkcs1privkey pkcs1privkey_t;
30
31 struct pkcs1privkey {
32     chunk_t pkcs1object;
33     chunk_t field[8];
34 };
35
36 /* used for initialization */
37
38 extern const pkcs1privkey_t empty_pkcs1privkey;
39
40 extern bool parse_pkcs1_private_key(chunk_t blob, pkcs1privkey_t *key);
41 extern pkcs1privkey_t* load_pkcs1_private_key(const char* filename,
42                                               const char* passphrase);
43
44 extern bool parse_pkcs7_cert(chunk_t blob, x509cert_t **cert);