Botan
1.10.17
src
cms
cms_dec.h
Go to the documentation of this file.
1
/*
2
* CMS Decoding
3
* (C) 1999-2007 Jack Lloyd
4
*
5
* Distributed under the terms of the Botan license
6
*/
7
8
#ifndef BOTAN_CMS_DECODER_H__
9
#define BOTAN_CMS_DECODER_H__
10
11
#include <botan/x509cert.h>
12
#include <botan/x509stor.h>
13
#include <botan/pkcs8.h>
14
#include <botan/ber_dec.h>
15
16
namespace
Botan
{
17
18
/**
19
* CMS Decoding Operation
20
*/
21
class
BOTAN_DLL
CMS_Decoder
22
{
23
public
:
24
enum
Status
{
GOOD
,
BAD
,
NO_KEY
,
FAILURE
};
25
26
enum
Content_Type
{
DATA
,
UNKNOWN
,
COMPRESSED
,
ENVELOPED
,
SIGNED
,
27
AUTHENTICATED
,
DIGESTED
};
28
29
Status layer_status()
const
;
30
Content_Type layer_type()
const
;
31
std::string layer_info()
const
;
32
std::string
layer_algo
()
const
;
33
std::string
get_data
()
const
;
34
std::vector<X509_Certificate>
get_certs
()
const
;
35
std::vector<X509_CRL>
get_crls
()
const
;
36
37
void
next_layer
() { decode_layer(); }
38
39
void
add_key(
Private_Key
*);
40
41
CMS_Decoder
(
DataSource
&,
const
X509_Store
&,
42
Private_Key
* = 0);
43
private
:
44
std::string get_passphrase(
const
std::string&);
45
void
read_econtent(
BER_Decoder
&);
46
void
initial_read(
DataSource
&);
47
void
decode_layer();
48
void
decompress(
BER_Decoder
&);
49
50
X509_Store
store;
51
std::vector<std::string> passphrases;
52
std::vector<Private_Key*> keys;
53
54
OID
type, next_type;
55
SecureVector<byte>
data;
56
Status status;
57
std::string info;
58
};
59
60
}
61
62
#endif
Botan::BER_Decoder
Definition
ber_dec.h:20
Botan::CMS_Decoder
Definition
cms_dec.h:22
Botan::CMS_Decoder::Content_Type
Content_Type
Definition
cms_dec.h:26
Botan::CMS_Decoder::DIGESTED
@ DIGESTED
Definition
cms_dec.h:27
Botan::CMS_Decoder::SIGNED
@ SIGNED
Definition
cms_dec.h:26
Botan::CMS_Decoder::ENVELOPED
@ ENVELOPED
Definition
cms_dec.h:26
Botan::CMS_Decoder::UNKNOWN
@ UNKNOWN
Definition
cms_dec.h:26
Botan::CMS_Decoder::COMPRESSED
@ COMPRESSED
Definition
cms_dec.h:26
Botan::CMS_Decoder::DATA
@ DATA
Definition
cms_dec.h:26
Botan::CMS_Decoder::AUTHENTICATED
@ AUTHENTICATED
Definition
cms_dec.h:27
Botan::CMS_Decoder::CMS_Decoder
CMS_Decoder(DataSource &, const X509_Store &, Private_Key *=0)
Definition
cms_dec.cpp:19
Botan::CMS_Decoder::Status
Status
Definition
cms_dec.h:24
Botan::CMS_Decoder::NO_KEY
@ NO_KEY
Definition
cms_dec.h:24
Botan::CMS_Decoder::GOOD
@ GOOD
Definition
cms_dec.h:24
Botan::CMS_Decoder::BAD
@ BAD
Definition
cms_dec.h:24
Botan::CMS_Decoder::FAILURE
@ FAILURE
Definition
cms_dec.h:24
Botan::CMS_Decoder::get_certs
std::vector< X509_Certificate > get_certs() const
Botan::CMS_Decoder::get_crls
std::vector< X509_CRL > get_crls() const
Botan::CMS_Decoder::layer_algo
std::string layer_algo() const
Botan::CMS_Decoder::next_layer
void next_layer()
Definition
cms_dec.h:37
Botan::CMS_Decoder::get_data
std::string get_data() const
Definition
cms_dec.cpp:85
Botan::DataSource
Definition
data_src.h:21
Botan::OID
Definition
asn1_oid.h:21
Botan::Private_Key
Definition
pk_keys.h:87
Botan::SecureVector
Definition
secmem.h:329
Botan::X509_Store
Definition
x509stor.h:49
Botan
Definition
algo_base.h:14
Generated by
1.18.0