summaryrefslogtreecommitdiffstats
path: root/botan/wrappers/swig/base.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'botan/wrappers/swig/base.cpp')
-rw-r--r--botan/wrappers/swig/base.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/botan/wrappers/swig/base.cpp b/botan/wrappers/swig/base.cpp
new file mode 100644
index 0000000..448b3d4
--- /dev/null
+++ b/botan/wrappers/swig/base.cpp
@@ -0,0 +1,61 @@
+/*************************************************
+* SWIG Interface for basic Botan interface *
+* (C) 1999-2003 Jack Lloyd *
+*************************************************/
+
+#include "base.h"
+#include <botan/init.h>
+
+#include <stdio.h>
+
+/*************************************************
+* Initialize the library *
+*************************************************/
+LibraryInitializer::LibraryInitializer(const char* args)
+ {
+ Botan::Init::initialize(args);
+ }
+
+/*************************************************
+* Shut down the library *
+*************************************************/
+LibraryInitializer::~LibraryInitializer()
+ {
+ Botan::Init::deinitialize();
+ }
+
+/*************************************************
+* Create a SymmetricKey *
+*************************************************/
+SymmetricKey::SymmetricKey(const std::string& str)
+ {
+ key = new Botan::SymmetricKey(str);
+ printf("STR CON: %p %p\n", this, key);
+ }
+
+/*************************************************
+* Create a SymmetricKey *
+*************************************************/
+SymmetricKey::SymmetricKey(u32bit n)
+ {
+ key = new Botan::SymmetricKey(n);
+ printf("N CON: %p %p\n", this, key);
+ }
+
+/*************************************************
+* Destroy a SymmetricKey *
+*************************************************/
+SymmetricKey::~SymmetricKey()
+ {
+ printf("DESTR: %p %p\n", this, key);
+ delete key;
+ key = 0;
+ //printf("deleted\n");
+ }
+
+/*************************************************
+* Create an InitializationVector *
+*************************************************/
+InitializationVector::InitializationVector(const std::string& str) : iv(str)
+ {
+ }