summaryrefslogtreecommitdiffstats
path: root/botan/wrappers/swig/base.h
diff options
context:
space:
mode:
authorKeith Isdale <keith.isdale@nokia.com>2010-07-26 14:56:53 +1000
committerKeith Isdale <keith.isdale@nokia.com>2010-07-26 14:56:53 +1000
commit9f034793bcfc51c2b7c1dd14db806f7258f9a9eb (patch)
tree63bd0f50ce5b77828ad8205eafd7b9412810499e /botan/wrappers/swig/base.h
parent619d92cfef29e653bfdf852e83888e50cfc4348f (diff)
parent65271649dbc90f3af1184ad1b23bdb64c0c07d07 (diff)
Merge branch 'master' of git://git-nokia.trolltech.com.au/qtsoftware/research/qtuitest
Diffstat (limited to 'botan/wrappers/swig/base.h')
-rw-r--r--botan/wrappers/swig/base.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/botan/wrappers/swig/base.h b/botan/wrappers/swig/base.h
new file mode 100644
index 0000000..341a5c3
--- /dev/null
+++ b/botan/wrappers/swig/base.h
@@ -0,0 +1,102 @@
+/*************************************************
+* SWIG Interface for Botan *
+* (C) 1999-2003 Jack Lloyd *
+*************************************************/
+
+#ifndef BOTAN_WRAP_BASE_H__
+#define BOTAN_WRAP_BASE_H__
+
+#include <botan/pipe.h>
+
+#if !defined(SWIG)
+ #define OUTPUT
+ #define INOUT
+#endif
+
+/*************************************************
+* Typedefs *
+*************************************************/
+typedef unsigned char byte;
+typedef unsigned int u32bit;
+
+/*************************************************
+* Library Initalization/Shutdown Object *
+*************************************************/
+class LibraryInitializer
+ {
+ public:
+ LibraryInitializer(const char*);
+ ~LibraryInitializer();
+ };
+
+/*************************************************
+* Symmetric Key Object *
+*************************************************/
+class SymmetricKey
+ {
+ public:
+ std::string as_string() const { return key->as_string(); }
+ u32bit length() const { return key->length(); }
+ SymmetricKey(u32bit = 0);
+ SymmetricKey(const std::string&);
+ ~SymmetricKey();
+ private:
+ Botan::SymmetricKey* key;
+ };
+
+/*************************************************
+* Initialization Vector Object *
+*************************************************/
+class InitializationVector
+ {
+ public:
+ std::string as_string() const { return iv.as_string(); }
+ u32bit length() const { return iv.length(); }
+ InitializationVector(u32bit n = 0) { iv.change(n); }
+ InitializationVector(const std::string&);
+ private:
+ Botan::InitializationVector iv;
+ };
+
+/*************************************************
+* Filter Object *
+*************************************************/
+class Filter
+ {
+ public:
+ Filter(const char*);
+ //Filter(const char*, const SymmetricKey&);
+ //Filter(const char*, const SymmetricKey&, const InitializationVector&);
+ ~Filter();
+ private:
+ friend class Pipe;
+ Botan::Filter* filter;
+ bool pipe_owns;
+ };
+
+/*************************************************
+* Pipe Object *
+*************************************************/
+class Pipe
+ {
+ public:
+ static const u32bit DEFAULT_MESSAGE = 0xFFFFFFFF;
+
+ void write_file(const char*);
+ void write_string(const char*);
+
+ u32bit read(byte*, u32bit, u32bit = DEFAULT_MESSAGE);
+ std::string read_all_as_string(u32bit = DEFAULT_MESSAGE);
+
+ u32bit remaining(u32bit = DEFAULT_MESSAGE);
+
+ void start_msg();
+ void end_msg();
+
+ Pipe(Filter* = 0, Filter* = 0, Filter* = 0, Filter* = 0);
+ ~Pipe();
+ private:
+ Botan::Pipe* pipe;
+ };
+
+#endif