[xmlsec] Load hmac key for signature

Monica Lau mllau2004 at yahoo.com
Mon Oct 11 10:33:33 PDT 2004


Thanks much -- that worked great!
 
Regards,
Monica


Aleksey Sanin <aleksey at aleksey.com> wrote:
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


		
---------------------------------
Do you Yahoo!?
vote.yahoo.com - Register online to vote today!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.aleksey.com/pipermail/xmlsec/attachments/20041011/4c2cca5e/attachment-0002.htm


More information about the xmlsec mailing list