[xmlsec] creating a ds:KeyInfo object

Aleksey Sanin aleksey at aleksey.com
Tue Dec 28 16:03:20 PST 2004

Oh, I see what are you tryng to do. OK, this is simple.
xmlSecKeyInfoNodeWrite() writes key data into KeyInfo
node according to the template in the KeyInfo node.
For example, if you want to write only key name,
you create template like this:

If you want to write key name and certificate info,
you create template like this:

and so on. From the code in your prev message, it seems
that your KeyInfo template is an empty KeyInfo node. Thus
the output is also an empty KeyInfo node.

And you got this assert in xmlSecKeyDebugXmlDump function
because the key structure you have is not valid. It does not
have the key value itself.


Smith Baylor wrote:
> All that I am trying to do is:
> 1.  Load the cert file
> 2.  Write the public key X509Data into a newly created KeyInfo Object
> I don't want an entire Signature object with ds:Signature node.  Are
> there any examples of how to write a custom KeyData Object?
> I still cannot still understand what is wrong with this:
> xmlSecKeyInfoNodeWrite(cur, key, keyInfoCtx)
> where xmlSecKeyPtr key = xmlSecKeyCreate(); xmlNodePtr cur = NULL;

More information about the xmlsec mailing list