Ops... Sorry for mistake. This is the correct function:

------------------------------------
xmlSecKeyPtr CreateHmacKey(const xmlSecByte * buf, xmlSecSize size)
{
  xmlSecKeyPtr key;
  xmlSecKeyDataPtr key_data;
  int ret;

  key = xmlSecKeyCreate();
  if(!key) {
    return (NULL);
  }

  key_data = xmlSecKeyDataCreate(xmlSecKeyDataHmacId);
  if(!key_data) {
    xmlSecKeyDestroy(key);
    return (NULL);
  }

  ret = xmlSecKeySetValue(key, key_data);
  if(ret < 0) {
    xmlSecKeyDataDestroy(key_data);
    xmlSecKeyDestroy(key);
    return (NULL);
  }

  ret = xmlSecOpenSSLKeyDataHmacSet(key_data, buf, size);
  if(ret < 0) {
    xmlSecKeyDestroy(key);
    return (NULL);
  }

  return (key);
}

------------------------------------


Aleksey

_______________________________________________
xmlsec mailing list
[EMAIL PROTECTED]
http://www.aleksey.com/mailman/listinfo/xmlsec

Reply via email to