Exemple #1
0
PyObject *xmlSecKeyInfoCtx_setattr(PyObject *self, PyObject *args) {
  PyObject *keyInfoCtx_obj, *value_obj;
  xmlSecKeyInfoCtxPtr keyInfoCtx;
  const char *name;

  if (CheckArgs(args, "OS?:keyInfoCtxSetAttr")) {
    if (!PyArg_ParseTuple(args, "OsO:keyInfoCtxSetAttr",
			  &keyInfoCtx_obj, &name, &value_obj))
      return NULL;
  }
  else return NULL;

  keyInfoCtx = xmlSecKeyInfoCtxPtr_get(keyInfoCtx_obj);
    
  if (!strcmp(name, "flags"))
    keyInfoCtx->flags = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "flags2"))
    keyInfoCtx->flags2 = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "keysMngr"))
    keyInfoCtx->keysMngr = xmlSecKeysMngrPtr_get(value_obj);
  else if (!strcmp(name, "mode"))
    keyInfoCtx->mode = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "enabledKeyData"))
    keyInfoCtx->enabledKeyData = *(xmlSecPtrListPtr_get(value_obj));
  else if (!strcmp(name, "base64LineSize"))
    keyInfoCtx->base64LineSize = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "retrievalMethodCtx"))
    keyInfoCtx->retrievalMethodCtx = *(xmlSecTransformCtxPtr_get(value_obj));
  else if (!strcmp(name, "maxRetrievalMethodLevel"))
    keyInfoCtx->maxRetrievalMethodLevel = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "encCtx"))
    keyInfoCtx->encCtx = xmlSecEncCtxPtr_get(value_obj);
  else if (!strcmp(name, "maxEncryptedKeyLevel"))
    keyInfoCtx->maxEncryptedKeyLevel = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "certsVerificationTime"))
    keyInfoCtx->certsVerificationTime = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "certsVerificationDepth"))
    keyInfoCtx->certsVerificationDepth = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "curRetrievalMethodLevel"))
    keyInfoCtx->curRetrievalMethodLevel = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "curEncryptedKeyLevel"))
    keyInfoCtx->curEncryptedKeyLevel = PyInt_AsLong(value_obj);
  else if (!strcmp(name, "keyReq"))
    keyInfoCtx->keyReq = *(xmlSecKeyReqPtr_get(value_obj));

  Py_INCREF(Py_None);
  return (Py_None);
}
Exemple #2
0
PyObject *xmlsec_TransformSetKeyReq(PyObject *self, PyObject *args) {
  PyObject *transform_obj, *keyReq_obj;
  xmlSecTransformPtr transform;
  xmlSecKeyReqPtr keyReq;
  int ret;

  if (CheckArgs(args, "OO:transformSetKeyReq")) {
    if(!PyArg_ParseTuple(args, (char *) "OO:transformSetKeyReq",
			 &transform_obj, &keyReq_obj))
      return NULL;
  }
  else return NULL;

  transform = xmlSecTransformPtr_get(transform_obj);
  keyReq = xmlSecKeyReqPtr_get(keyReq_obj);
  ret = xmlSecTransformSetKeyReq(transform, keyReq);

  return (wrap_int(ret));
}