/** * xmlSecEncCtxCreate: * @keysMngr: the pointer to keys manager. * * Creates <enc:EncryptedData/> element processing context. * The caller is responsible for destroying returned object by calling * #xmlSecEncCtxDestroy function. * * Returns: pointer to newly allocated context object or NULL if an error * occurs. */ xmlSecEncCtxPtr xmlSecEncCtxCreate(xmlSecKeysMngrPtr keysMngr) { xmlSecEncCtxPtr encCtx; int ret; encCtx = (xmlSecEncCtxPtr) xmlMalloc(sizeof(xmlSecEncCtx)); if(encCtx == NULL) { xmlSecError(XMLSEC_ERRORS_HERE, NULL, NULL, XMLSEC_ERRORS_R_MALLOC_FAILED, "sizeof(xmlSecEncCtx)=%d", sizeof(xmlSecEncCtx)); return(NULL); } ret = xmlSecEncCtxInitialize(encCtx, keysMngr); if(ret < 0) { xmlSecError(XMLSEC_ERRORS_HERE, NULL, "xmlSecEncCtxInitialize", XMLSEC_ERRORS_R_XMLSEC_FAILED, XMLSEC_ERRORS_NO_MESSAGE); xmlSecEncCtxDestroy(encCtx); return(NULL); } return(encCtx); }
PyObject *xmlsec_EncCtxInitialize(PyObject *self, PyObject *args) { PyObject *encCtx_obj, *keysMngr_obj; xmlSecEncCtxPtr encCtx; xmlSecKeysMngrPtr keysMngr = NULL; if (CheckArgs(args, "Oo:encCtxInitialize")) { if (!PyArg_ParseTuple(args, "OO:encCtxInitialize", &encCtx_obj, &keysMngr_obj)) return NULL; } else return NULL; encCtx = xmlSecEncCtxPtr_get(encCtx_obj); keysMngr = xmlSecKeysMngrPtr_get(keysMngr_obj); return (wrap_int(xmlSecEncCtxInitialize(encCtx, keysMngr))); }