]> git.ipfire.org Git - people/ms/strongswan.git/blob - programs/pluto/pkcs7.h
- import of strongswan-2.7.0
[people/ms/strongswan.git] / programs / pluto / pkcs7.h
1 /* Support of PKCS#7 data structures
2 * Copyright (C) 2005 Jan Hutter, Martin Willi
3 * Copyright (C) 2002-2005 Andreas Steffen
4 * Hochschule fuer Technik Rapperswil, Switzerland
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * for more details.
15 *
16 * RCSID $Id: pkcs7.h,v 1.10 2005/12/22 22:11:24 as Exp $
17 */
18
19 #ifndef _PKCS7_H
20 #define _PKCS7_H
21
22 #include "defs.h"
23 #include "pkcs1.h"
24 #include "x509.h"
25
26 /* Access structure for a PKCS#7 ContentInfo object */
27
28 typedef struct contentInfo contentInfo_t;
29
30 struct contentInfo {
31 int type;
32 chunk_t content;
33 };
34
35 extern const contentInfo_t empty_contentInfo;
36
37 extern bool pkcs7_parse_contentInfo(chunk_t blob, u_int level0
38 , contentInfo_t *cInfo);
39 extern bool pkcs7_parse_signedData(chunk_t blob, contentInfo_t *data
40 , x509cert_t **cert, chunk_t *attributes, const x509cert_t *cacert);
41 extern bool pkcs7_parse_envelopedData(chunk_t blob, chunk_t *data
42 , chunk_t serialNumber, const RSA_private_key_t *key);
43 extern chunk_t pkcs7_contentType_attribute(void);
44 extern chunk_t pkcs7_messageDigest_attribute(chunk_t content, int digest_alg);
45 extern chunk_t pkcs7_build_issuerAndSerialNumber(const x509cert_t *cert);
46 extern chunk_t pkcs7_build_signedData(chunk_t data, chunk_t attributes
47 ,const x509cert_t *cert, int digest_alg, const RSA_private_key_t *key);
48 extern chunk_t pkcs7_build_envelopedData(chunk_t data, const x509cert_t *cert
49 , int cipher);
50
51 #endif /* _PKCS7_H */