Botan 1.10.17

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::Private_Key
Definition: pk_keys.h:86
Botan::X509_Store
Definition: x509stor.h:48
Botan::CMS_Decoder::Status
Status
Definition: cms_dec.h:24
Botan::CMS_Decoder::Content_Type
Content_Type
Definition: cms_dec.h:26
dist.get_certs
def get_certs(db, rev_id)
Definition: dist.py:47
Botan::DataSource
Definition: data_src.h:20
Botan::CMS_Decoder::next_layer
void next_layer()
Definition: cms_dec.h:37
Botan::CMS_Decoder::UNKNOWN
Definition: cms_dec.h:26
Botan
Definition: algo_base.h:14
Botan::CMS_Decoder
Definition: cms_dec.h:21
Botan::SecureVector< byte >
Botan::OID
Definition: asn1_oid.h:20
Botan::BER_Decoder
Definition: ber_dec.h:19