aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-06-24 02:06:30 +0000
committerlloyd <[email protected]>2006-06-24 02:06:30 +0000
commit5ff46baa0e2211e660c6925f5c42153c70eb1b11 (patch)
tree448cd34eec0238e43c1cb5808030c012aecde1ce /include
parent37a5509d230f4a84fbaa5a889cb40e19a2b0c0ad (diff)
Add an X509_GlobalState pointer to the library state.
Initial implementation of a factory for extension objects
Diffstat (limited to 'include')
-rw-r--r--include/libstate.h6
-rw-r--r--include/x509stat.h35
2 files changed, 40 insertions, 1 deletions
diff --git a/include/libstate.h b/include/libstate.h
index ff8266318..6e227140a 100644
--- a/include/libstate.h
+++ b/include/libstate.h
@@ -49,7 +49,10 @@ class Library_State
void add_engine(class Engine*);
- class Mutex* get_mutex();
+ class Mutex* get_mutex() const;
+
+ void set_x509_state(class X509_GlobalState*);
+ class X509_GlobalState& x509_state() const;
void set_transcoder(class Charset_Transcoder*);
std::string transcode(const std::string,
@@ -66,6 +69,7 @@ class Library_State
class Mutex_Factory* mutex_factory;
class Timer* timer;
+ class X509_GlobalState* x509_state_obj;
std::map<std::string, class Mutex*> locks;
std::map<std::string, std::string> settings;
diff --git a/include/x509stat.h b/include/x509stat.h
new file mode 100644
index 000000000..4822119aa
--- /dev/null
+++ b/include/x509stat.h
@@ -0,0 +1,35 @@
+/*************************************************
+* Globally Saved X.509 State *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#include <botan/asn1_oid.h>
+
+namespace Botan {
+
+/*************************************************
+* Prototype for a Certificate Extension *
+*************************************************/
+class Extension_Prototype
+ {
+ public:
+ virtual class Certificate_Extension* make(const OID&) = 0;
+ virtual ~Extension_Prototype() {}
+ };
+
+/*************************************************
+* X.509 Global State *
+*************************************************/
+class X509_GlobalState
+ {
+ public:
+ void add(Extension_Prototype*);
+ class Certificate_Extension* get_extension(const OID&) const;
+
+ X509_GlobalState();
+ ~X509_GlobalState();
+ private:
+ std::vector<Extension_Prototype*> prototypes;
+ };
+
+}