aboutsummaryrefslogtreecommitdiffstats
path: root/misc/python/src/core.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'misc/python/src/core.cpp')
-rw-r--r--misc/python/src/core.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/misc/python/src/core.cpp b/misc/python/src/core.cpp
index 6c8f61c1c..acb46c82e 100644
--- a/misc/python/src/core.cpp
+++ b/misc/python/src/core.cpp
@@ -1,19 +1,39 @@
/*************************************************
* Boost.Python module definition *
-* (C) 2005-2006 Jack Lloyd <[email protected]> *
+* (C) 1999-2006 The Botan Project *
*************************************************/
+#include <botan/init.h>
+#include <botan/symkey.h>
+using namespace Botan;
+
#include <boost/python.hpp>
-using namespace boost::python;
+namespace python = boost::python;
-extern void export_basic_types();
extern void export_filters();
extern void export_pipe();
extern void export_x509();
BOOST_PYTHON_MODULE(_botan)
{
- export_basic_types();
+ python::class_<LibraryInitializer>("LibraryInitializer")
+ .def(python::init< python::optional<std::string> >());
+
+ python::class_<OctetString>("OctetString")
+ .def(python::init< python::optional<std::string> >())
+ .def("as_string", &OctetString::as_string)
+ .def("length", &OctetString::length)
+ .def(python::self ^= python::self);
+
+ python::class_<SymmetricKey, python::bases<OctetString> >("SymmetricKey")
+ .def(python::init< python::optional<std::string> >())
+ .def(python::init< u32bit >());
+
+ python::class_<InitializationVector, python::bases<OctetString> >
+ ("InitializationVector")
+ .def(python::init< python::optional<std::string> >())
+ .def(python::init< u32bit >());
+
export_filters();
export_pipe();
export_x509();