diff --git a/include/wrapping_cert.h b/include/wrapping_cert.h index 123aca83605e61804a5d05f522dc4900acf6412c..b5e1a441eb5ef813b389255e17a122966f25fbbb 100644 --- a/include/wrapping_cert.h +++ b/include/wrapping_cert.h @@ -38,6 +38,9 @@ typedef struct PyCryptoCert{ dap_cert_t * cert; }PyCryptoCertObject; +int dap_cert_init_py(); +void dap_cert_deinit_py(); + PyObject* dap_cert_generate_py(PyObject *self, PyObject *args); PyObject* dap_cert_dump_py(PyObject *self, PyObject *args); PyObject* dap_cert_pkey_py(PyObject *self, PyObject *args); @@ -91,7 +94,7 @@ static PyTypeObject g_crypto_cert_type_py = { 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ - "Cert objects", /* tp_doc */ + "Crypto cert object", /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ diff --git a/src/wrapping_cert.c b/src/wrapping_cert.c index ce80fdb6f6308bb4380ab8c5dee48b99645b980a..3ebf7e54df0ac3121aad4f018ec8bb306f8d7783 100644 --- a/src/wrapping_cert.c +++ b/src/wrapping_cert.c @@ -162,10 +162,21 @@ PyObject* dap_cert_folder_add_py(PyObject *self, PyObject *args) PyObject* dap_cert_folder_get_py(PyObject *self, PyObject *args) { - (void) self; - (void) args; - /// TODO: Implement it! - PyErr_SetString(PyExc_TypeError, "Unimplemented function"); - return NULL; + (void)self; + const char *a_folder_path; + if(!PyArg_ParseTuple(args, "s", &a_folder_path)) + return NULL; + dap_cert_add_folder(a_folder_path); + return PyLong_FromLong(0); +} + +int dap_cert_init_py(void) +{ + return dap_cert_init(); +} + +void dap_cert_deinit_py(void) +{ + dap_cert_deinit(); }