[xmlsec] changes in XML DSig api
Aleksey Sanin
aleksey@aleksey.com
Sat, 20 Apr 2002 22:20:32 -0700
Hi, All!
I recently had few very interesting conversation with different
people and they convinced me that there is a better way of
creating XML DSig dynamically than the way I have now.
I already implemented this idea XML Enc API and in the next
release I am going to change the XML DSig API as well. The changes
are not dramatic and conversion should be pretty simple.
However, I would like to hear any objections and reasons
why I should not do it.
Bellow you can find both current and new API for comparison.
Please, speak now or forever hold your peace! :)
Aleksey.
/**
* New API
*/
typedef xmlNodePtr xmlDSigTmplPtr;
xmlDSigTmplPtr xmlDSigCreate (const xmlChar *id);
void xmlDSigDestroy (xmlDSigTmplPtr
tmpl);
xmlNodePtr xmlDSigAddKeyInfo (xmlDSigTmplPtr tmpl,
const xmlChar *id);
xmlNodePtr xmlDSigAddObject (xmlDSigTmplPtr tmpl,
const xmlChar *id,
const xmlChar *mimeType,
const xmlChar *encoding);
xmlNodePtr xmlDSigAddManifest (xmlDSigTmplPtr tmpl,
const xmlChar *id);
xmlNodePtr xmlDSigAddC14NMethod (xmlDSigTmplPtr tmpl,
xmlSecTransformId encMethod);
xmlNodePtr xmlDSigAddSignMethod (xmlDSigTmplPtr tmpl,
xmlSecTransformId encMethod);
xmlNodePtr xmlDSigAddReference (xmlDSigTmplPtr tmpl,
const xmlChar *id,
const xmlChar *uri,
const xmlChar *type);
xmlNodePtr xmlDSigRefAddDigestMethod (xmlNodePtr refNode,
xmlSecTransformId encMethod);
xmlNodePtr xmlDSigRefAddTransform (xmlDSigTmplPtr tmpl,
xmlNodePtr refNode,
xmlSecTransformId transform);
xmlNodePtr xmlDSigManifestAddReference (xmlNodePtr manifestNode,
const xmlChar *id,
const xmlChar *uri,
const xmlChar *type);
/**
* Current API
*/
xmlNodePtr xmlDSigSignatureNodeCreate (xmlDocPtr doc,
const xmlChar *id,
xmlSecTransformId c14nMethod,
void *c14nData,
xmlSecTransformId signMethod,
void *signData);
xmlNodePtr xmlDSigReferenceNodeCreate (xmlNodePtr signatureNode,
const xmlChar *id,
const xmlChar *uri,
const xmlChar *type,
xmlSecTransformId digestMethod,
void *digestData);
xmlNodePtr xmlDSigTransformNodeCreate (xmlNodePtr referenceNode,
xmlSecTransformId transformMethod,
void *transformData);
xmlNodePtr xmlDSigKeyInfoNodeCreate (xmlNodePtr signatureNode,
const xmlChar *id,
xmlSecKeyOrigin origin);
xmlNodePtr xmlDSigObjectNodeCreate (xmlNodePtr signatureNode,
const xmlChar *id);
xmlNodePtr xmlDSigManifestNodeCreate (xmlNodePtr signatureNode,
const xmlChar *id);