Functions
xmlSecDSigCtxCreate ()
xmlSecDSigCtxPtr
xmlSecDSigCtxCreate (xmlSecKeysMngrPtr keysMngr
);
Creates <dsig:Signature/> element processing context.
The caller is responsible for destroying returned object by calling
xmlSecDSigCtxDestroy function.
Returns
pointer to newly allocated context object or NULL if an error
occurs.
xmlSecDSigCtxInitialize ()
int
xmlSecDSigCtxInitialize (xmlSecDSigCtxPtr dsigCtx
,
xmlSecKeysMngrPtr keysMngr
);
Initializes <dsig:Signature/> element processing context.
The caller is responsible for cleaning up returned object by calling
xmlSecDSigCtxFinalize function.
Returns
0 on success or a negative value if an error occurs.
xmlSecDSigCtxSign ()
int
xmlSecDSigCtxSign (xmlSecDSigCtxPtr dsigCtx
,
xmlNodePtr tmpl
);
Signs the data as described in tmpl
node.
Returns
0 on success or a negative value if an error occurs.
xmlSecDSigCtxVerify ()
int
xmlSecDSigCtxVerify (xmlSecDSigCtxPtr dsigCtx
,
xmlNodePtr node
);
Vaidates signature in the node
. The verification result is returned
in status member of the dsigCtx
object.
Returns
0 on success (check status member of dsigCtx
to get
signature verification result) or a negative value if an error occurs.
xmlSecDSigCtxEnableReferenceTransform ()
int
xmlSecDSigCtxEnableReferenceTransform (xmlSecDSigCtxPtr dsigCtx
,
xmlSecTransformId transformId
);
Enables transformId
for <dsig:Reference/> elements processing.
Returns
0 on success or a negative value if an error occurs.
xmlSecDSigCtxEnableSignatureTransform ()
int
xmlSecDSigCtxEnableSignatureTransform (xmlSecDSigCtxPtr dsigCtx
,
xmlSecTransformId transformId
);
Enables transformId
for <dsig:SignedInfo/> element processing.
Returns
0 on success or a negative value if an error occurs.
xmlSecDSigCtxGetPreSignBuffer ()
xmlSecBufferPtr
xmlSecDSigCtxGetPreSignBuffer (xmlSecDSigCtxPtr dsigCtx
);
Gets pointer to the buffer with serialized <dsig:SignedInfo/> element
just before signature claculation (valid if and only if
XMLSEC_DSIG_FLAGS_STORE_SIGNATURE context flag is set.
Returns
0 on success or a negative value if an error occurs.
xmlSecDSigCtxDebugDump ()
void
xmlSecDSigCtxDebugDump (xmlSecDSigCtxPtr dsigCtx
,
FILE *output
);
Prints the debug information about dsigCtx
to output
.
xmlSecDSigCtxDebugXmlDump ()
void
xmlSecDSigCtxDebugXmlDump (xmlSecDSigCtxPtr dsigCtx
,
FILE *output
);
Prints the debug information about dsigCtx
to output
in XML format.
xmlSecDSigReferenceCtxProcessNode ()
int
xmlSecDSigReferenceCtxProcessNode (xmlSecDSigReferenceCtxPtr dsigRefCtx
,
xmlNodePtr node
);
The Reference Element (http://www.w3.org/TR/xmldsig-core/sec-Reference)
Reference is an element that may occur one or more times. It specifies
a digest algorithm and digest value, and optionally an identifier of the
object being signed, the type of the object, and/or a list of transforms
to be applied prior to digesting. The identification (URI) and transforms
describe how the digested content (i.e., the input to the digest method)
was created. The Type attribute facilitates the processing of referenced
data. For example, while this specification makes no requirements over
external data, an application may wish to signal that the referent is a
Manifest. An optional ID attribute permits a Reference to be referenced
from elsewhere.
Returns
0 on succes or aa negative value otherwise.
xmlSecDSigReferenceCtxDebugDump ()
void
xmlSecDSigReferenceCtxDebugDump (xmlSecDSigReferenceCtxPtr dsigRefCtx
,
FILE *output
);
Prints debug information about dsigRefCtx
to output
.
xmlSecDSigReferenceCtxDebugXmlDump ()
void
xmlSecDSigReferenceCtxDebugXmlDump (xmlSecDSigReferenceCtxPtr dsigRefCtx
,
FILE *output
);
Prints debug information about dsigRefCtx
to output
in output format.
xmlSecDSigReferenceCtxListGetKlass ()
xmlSecPtrListId
xmlSecDSigReferenceCtxListGetKlass (void
);
The <dsig:Reference/> element processing contexts list klass.
Returns
<dsig:Reference/> element processing context list klass.
Types and Values
enum xmlSecDSigStatus
XML Digital signature processing status.
XMLSEC_DSIG_FLAGS_IGNORE_MANIFESTS
#define XMLSEC_DSIG_FLAGS_IGNORE_MANIFESTS 0x00000001
If this flag is set then <dsig:Manifests/> nodes will not be processed.
XMLSEC_DSIG_FLAGS_STORE_SIGNEDINFO_REFERENCES
#define XMLSEC_DSIG_FLAGS_STORE_SIGNEDINFO_REFERENCES 0x00000002
If this flag is set then pre-digest buffer for <dsig:Reference/> child
of <dsig:KeyInfo/> element will be stored in xmlSecDSigCtx.
XMLSEC_DSIG_FLAGS_STORE_MANIFEST_REFERENCES
#define XMLSEC_DSIG_FLAGS_STORE_MANIFEST_REFERENCES 0x00000004
If this flag is set then pre-digest buffer for <dsig:Reference/> child
of <dsig:Manifest/> element will be stored in xmlSecDSigCtx.
XMLSEC_DSIG_FLAGS_STORE_SIGNATURE
#define XMLSEC_DSIG_FLAGS_STORE_SIGNATURE 0x00000008
If this flag is set then pre-signature buffer for <dsig:SignedInfo/>
element processing will be stored in xmlSecDSigCtx.
XMLSEC_DSIG_FLAGS_USE_VISA3D_HACK
#define XMLSEC_DSIG_FLAGS_USE_VISA3D_HACK 0x00000010
If this flag is set then URI ID references are resolved directly
without using XPointers. This allows one to sign/verify Visa3D
documents that don't follow XML, XPointer and XML DSig specifications.
struct xmlSecDSigCtx
struct xmlSecDSigCtx {
/* these data user can set before performing the operation */
void* userData;
unsigned int flags;
unsigned int flags2;
xmlSecKeyInfoCtx keyInfoReadCtx;
xmlSecKeyInfoCtx keyInfoWriteCtx;
xmlSecTransformCtx transformCtx;
xmlSecTransformUriType enabledReferenceUris;
xmlSecPtrListPtr enabledReferenceTransforms;
xmlSecTransformCtxPreExecuteCallback referencePreExecuteCallback;
xmlSecTransformId defSignMethodId;
xmlSecTransformId defC14NMethodId;
xmlSecTransformId defDigestMethodId;
/* these data are returned */
xmlSecKeyPtr signKey;
xmlSecTransformOperation operation;
xmlSecBufferPtr result;
xmlSecDSigStatus status;
xmlSecTransformPtr signMethod;
xmlSecTransformPtr c14nMethod;
xmlSecTransformPtr preSignMemBufMethod;
xmlNodePtr signValueNode;
xmlChar* id;
xmlSecPtrList signedInfoReferences;
xmlSecPtrList manifestReferences;
/* reserved for future */
void* reserved0;
void* reserved1;
};
XML DSig processing context.
enum xmlSecDSigReferenceOrigin
The possible <dsig:Reference/> node locations: in the <dsig:SignedInfo/>
node or in the <dsig:Manifest/> node.
struct xmlSecDSigReferenceCtx
struct xmlSecDSigReferenceCtx {
void* userData;
xmlSecDSigCtxPtr dsigCtx;
xmlSecDSigReferenceOrigin origin;
xmlSecTransformCtx transformCtx;
xmlSecTransformPtr digestMethod;
xmlSecBufferPtr result;
xmlSecDSigStatus status;
xmlSecTransformPtr preDigestMemBufMethod;
xmlChar* id;
xmlChar* uri;
xmlChar* type;
/* reserved for future */
void* reserved0;
void* reserved1;
};
The <dsig:Reference/> processing context.
xmlSecDSigReferenceCtxListId
#define xmlSecDSigReferenceCtxListId
The references list klass.