blob: d42d82b0b43b6604433eb9907f2169bc233255a4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
/*
* Copyright (C) 2012 Martin Willi
* Copyright (C) 2012 revosec AG
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*/
/**
* @defgroup pkcs7 pkcs7
* @{ @ingroup containers
*/
#ifndef PKCS7_H_
#define PKCS7_H_
#include <credentials/containers/container.h>
typedef struct pkcs7_t pkcs7_t;
/**
* PKCS#7/CMS container type.
*/
struct pkcs7_t {
/**
* Implements container_t.
*/
container_t container;
/**
* Get an authenticated PKCS#9 attribute from PKCS#7 signerInfo.
*
* To select the signerInfo structure to get the attribute from, pass
* the enumerator position from container_t.create_signature_enumerator().
*
* The attribute returned does not contain type information and must be
* freed after use.
*
* @param oid OID from the attribute to get
* @param enumerator enumerator to select signerInfo
* @param value chunk receiving attribute value, allocated
* @return TRUE if attribute found
*/
bool (*get_attribute)(pkcs7_t *this, int oid, enumerator_t *enumerator,
chunk_t *value);
/**
* Create an enumerator over attached certificates.
*
* @return enumerator over certificate_t
*/
enumerator_t* (*create_cert_enumerator)(pkcs7_t *this);
};
#endif /** PKCS7_H_ @}*/
|