monotone

monotone Mtn Source Tree

Root/botan/x509_obj.h

1/*************************************************
2* X.509 SIGNED Object Header File *
3* (C) 1999-2006 The Botan Project *
4*************************************************/
5
6#ifndef BOTAN_X509_OBJECT_H__
7#define BOTAN_X509_OBJECT_H__
8
9#include <botan/asn1_obj.h>
10#include <botan/pipe.h>
11#include <vector>
12
13namespace Botan {
14
15/*************************************************
16* Generic X.509 SIGNED Object *
17*************************************************/
18class X509_Object
19 {
20 public:
21 SecureVector<byte> tbs_data() const;
22 SecureVector<byte> signature() const;
23 AlgorithmIdentifier signature_algorithm() const;
24
25 static MemoryVector<byte> make_signed(class PK_Signer*,
26 const AlgorithmIdentifier&,
27 const MemoryRegion<byte>&);
28
29 bool check_signature(class Public_Key&) const;
30
31 void encode(Pipe&, X509_Encoding = PEM) const;
32 SecureVector<byte> BER_encode() const;
33 std::string PEM_encode() const;
34
35 X509_Object(DataSource&, const std::string&);
36 X509_Object(const std::string&, const std::string&);
37 virtual ~X509_Object() {}
38 protected:
39 void do_decode();
40 X509_Object() {}
41 AlgorithmIdentifier sig_algo;
42 SecureVector<byte> tbs_bits, sig;
43 private:
44 virtual void force_decode() = 0;
45 void init(DataSource&, const std::string&);
46 void decode_info(DataSource&);
47 std::vector<std::string> PEM_labels_allowed;
48 std::string PEM_label_pref;
49 };
50
51}
52
53#endif

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status