aboutsummaryrefslogtreecommitdiffstats
path: root/modules/x509/x509_obj.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-28 19:16:15 +0000
committerlloyd <[email protected]>2008-09-28 19:16:15 +0000
commit8534c9a67226ccffe7acbefbf3905aba10e88de3 (patch)
tree536e96a8b2763515104d6c90abddd3eb8aa74b19 /modules/x509/x509_obj.h
parent26ad026e8eb0521a9fb2f313f07f8fc7222d2ea8 (diff)
Create an x509 module containing all of the X509 certificate and CA
code as well as the code for handling PKCS #10 requests.
Diffstat (limited to 'modules/x509/x509_obj.h')
-rw-r--r--modules/x509/x509_obj.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/modules/x509/x509_obj.h b/modules/x509/x509_obj.h
new file mode 100644
index 000000000..8808fd686
--- /dev/null
+++ b/modules/x509/x509_obj.h
@@ -0,0 +1,56 @@
+/*************************************************
+* X.509 SIGNED Object Header File *
+* (C) 1999-2007 Jack Lloyd *
+*************************************************/
+
+#ifndef BOTAN_X509_OBJECT_H__
+#define BOTAN_X509_OBJECT_H__
+
+#include <botan/asn1_obj.h>
+#include <botan/pipe.h>
+#include <botan/enums.h>
+#include <botan/rng.h>
+#include <vector>
+
+namespace Botan {
+
+/*************************************************
+* Generic X.509 SIGNED Object *
+*************************************************/
+class BOTAN_DLL X509_Object
+ {
+ public:
+ SecureVector<byte> tbs_data() const;
+ SecureVector<byte> signature() const;
+ AlgorithmIdentifier signature_algorithm() const;
+
+ static MemoryVector<byte> make_signed(class PK_Signer*,
+ RandomNumberGenerator&,
+ const AlgorithmIdentifier&,
+ const MemoryRegion<byte>&);
+
+ bool check_signature(class Public_Key&) const;
+
+ void encode(Pipe&, X509_Encoding = PEM) const;
+ SecureVector<byte> BER_encode() const;
+ std::string PEM_encode() const;
+
+ X509_Object(DataSource&, const std::string&);
+ X509_Object(const std::string&, const std::string&);
+ virtual ~X509_Object() {}
+ protected:
+ void do_decode();
+ X509_Object() {}
+ AlgorithmIdentifier sig_algo;
+ SecureVector<byte> tbs_bits, sig;
+ private:
+ virtual void force_decode() = 0;
+ void init(DataSource&, const std::string&);
+ void decode_info(DataSource&);
+ std::vector<std::string> PEM_labels_allowed;
+ std::string PEM_label_pref;
+ };
+
+}
+
+#endif