Botan  1.10.9
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 
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
def get_certs(db, rev_id)
Definition: dist.py:47
void next_layer()
Definition: cms_dec.h:37