Top |
xmlSecDSigCtxPtr | xmlSecDSigCtxCreate () |
void | xmlSecDSigCtxDestroy () |
int | xmlSecDSigCtxInitialize () |
void | xmlSecDSigCtxFinalize () |
int | xmlSecDSigCtxSign () |
int | xmlSecDSigCtxVerify () |
int | xmlSecDSigCtxEnableReferenceTransform () |
int | xmlSecDSigCtxEnableSignatureTransform () |
xmlSecBufferPtr | xmlSecDSigCtxGetPreSignBuffer () |
void | xmlSecDSigCtxDebugDump () |
void | xmlSecDSigCtxDebugXmlDump () |
const char * | xmlSecDSigCtxGetStatusString () |
const char * | xmlSecDSigCtxGetFailureReasonString () |
xmlSecDSigReferenceCtxPtr | xmlSecDSigReferenceCtxCreate () |
void | xmlSecDSigReferenceCtxDestroy () |
int | xmlSecDSigReferenceCtxInitialize () |
void | xmlSecDSigReferenceCtxFinalize () |
int | xmlSecDSigReferenceCtxProcessNode () |
xmlSecBufferPtr | xmlSecDSigReferenceCtxGetPreDigestBuffer () |
void | xmlSecDSigReferenceCtxDebugDump () |
void | xmlSecDSigReferenceCtxDebugXmlDump () |
xmlSecPtrListId | xmlSecDSigReferenceCtxListGetKlass () |
enum | xmlSecDSigStatus |
enum | xmlSecDSigFailureReason |
#define | XMLSEC_DSIG_FLAGS_IGNORE_MANIFESTS |
#define | XMLSEC_DSIG_FLAGS_STORE_SIGNEDINFO_REFERENCES |
#define | XMLSEC_DSIG_FLAGS_STORE_MANIFEST_REFERENCES |
#define | XMLSEC_DSIG_FLAGS_STORE_SIGNATURE |
#define | XMLSEC_DSIG_FLAGS_USE_VISA3D_HACK |
struct | xmlSecDSigCtx |
enum | xmlSecDSigReferenceOrigin |
struct | xmlSecDSigReferenceCtx |
#define | xmlSecDSigReferenceCtxListId |
xmlSecDSigCtxPtr
xmlSecDSigCtxCreate (xmlSecKeysMngrPtr keysMngr
);
Creates <dsig:Signature/> element processing context. The caller is responsible for destroying returned object by calling xmlSecDSigCtxDestroy function.
void
xmlSecDSigCtxDestroy (xmlSecDSigCtxPtr dsigCtx
);
Destroy context object created with xmlSecDSigCtxCreate function.
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.
dsigCtx |
the pointer to <dsig:Signature/> processing context. |
|
keysMngr |
the pointer to keys manager. |
void
xmlSecDSigCtxFinalize (xmlSecDSigCtxPtr dsigCtx
);
Cleans up dsigCtx
object initialized with xmlSecDSigCtxInitialize function.
int xmlSecDSigCtxSign (xmlSecDSigCtxPtr dsigCtx
,xmlNodePtr tmpl
);
Signs the data as described in tmpl
node.
dsigCtx |
the pointer to <dsig:Signature/> processing context. |
|
tmpl |
the pointer to <dsig:Signature/> node with signature template. |
int xmlSecDSigCtxVerify (xmlSecDSigCtxPtr dsigCtx
,xmlNodePtr node
);
Validates signature in the node
. The verification result is returned
in status member of the dsigCtx
object.
dsigCtx |
the pointer to <dsig:Signature/> processing context. |
|
node |
the pointer with <dsig:Signature/> node. |
int xmlSecDSigCtxEnableReferenceTransform (xmlSecDSigCtxPtr dsigCtx
,xmlSecTransformId transformId
);
Enables transformId
for <dsig:Reference/> elements processing.
dsigCtx |
the pointer to <dsig:Signature/> processing context. |
|
transformId |
the transform klass. |
int xmlSecDSigCtxEnableSignatureTransform (xmlSecDSigCtxPtr dsigCtx
,xmlSecTransformId transformId
);
Enables transformId
for <dsig:SignedInfo/> element processing.
dsigCtx |
the pointer to <dsig:Signature/> processing context. |
|
transformId |
the transform klass. |
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.
void xmlSecDSigCtxDebugDump (xmlSecDSigCtxPtr dsigCtx
,FILE *output
);
Prints the debug information about dsigCtx
to output
.
dsigCtx |
the pointer to <dsig:Signature/> processing context. |
|
output |
the pointer to output FILE. |
void xmlSecDSigCtxDebugXmlDump (xmlSecDSigCtxPtr dsigCtx
,FILE *output
);
Prints the debug information about dsigCtx
to output
in XML format.
dsigCtx |
the pointer to <dsig:Signature/> processing context. |
|
output |
the pointer to output FILE. |
const char *
xmlSecDSigCtxGetStatusString (xmlSecDSigStatus status
);
Gets status as a string.
Returns status as a string.
const char *
xmlSecDSigCtxGetFailureReasonString (xmlSecDSigFailureReason failureReason
);
Gets failure reason as a string.
Returns failure reason as a string.
xmlSecDSigReferenceCtxPtr xmlSecDSigReferenceCtxCreate (xmlSecDSigCtxPtr dsigCtx
,xmlSecDSigReferenceOrigin origin
);
Creates new <dsig:Reference/> element processing context. Caller is responsible for destroying the returned context by calling xmlSecDSigReferenceCtxDestroy function.
dsigCtx |
the pointer to parent <dsig:Signature/> node processing context. |
|
origin |
the reference origin (<dsig:SignedInfo/> or <dsig:Manifest/> node). |
void
xmlSecDSigReferenceCtxDestroy (xmlSecDSigReferenceCtxPtr dsigRefCtx
);
Destroy context object created with xmlSecDSigReferenceCtxCreate function.
int xmlSecDSigReferenceCtxInitialize (xmlSecDSigReferenceCtxPtr dsigRefCtx
,xmlSecDSigCtxPtr dsigCtx
,xmlSecDSigReferenceOrigin origin
);
Initializes new <dsig:Reference/> element processing context. Caller is responsible for cleaning up the returned context by calling xmlSecDSigReferenceCtxFinalize function.
dsigRefCtx |
the pointer to <dsig:Reference/> element processing context. |
|
dsigCtx |
the pointer to parent <dsig:Signature/> node processing context. |
|
origin |
the reference origin (<dsig:SignedInfo/> or <dsig:Manifest/> node). |
void
xmlSecDSigReferenceCtxFinalize (xmlSecDSigReferenceCtxPtr dsigRefCtx
);
Cleans up context object created with xmlSecDSigReferenceCtxInitialize function.
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.
dsigRefCtx |
the pointer to <dsig:Reference/> element processing context. |
|
node |
the pointer to <dsig:Reference/> node. |
xmlSecBufferPtr
xmlSecDSigReferenceCtxGetPreDigestBuffer
(xmlSecDSigReferenceCtxPtr dsigRefCtx
);
Gets the results of <dsig:Reference/> node processing just before digesting (valid only if XMLSEC_DSIG_FLAGS_STORE_SIGNEDINFO_REFERENCES or XMLSEC_DSIG_FLAGS_STORE_MANIFEST_REFERENCES flas of signature context is set).
void xmlSecDSigReferenceCtxDebugDump (xmlSecDSigReferenceCtxPtr dsigRefCtx
,FILE *output
);
Prints debug information about dsigRefCtx
to output
.
dsigRefCtx |
the pointer to <dsig:Reference/> element processing context. |
|
output |
the pointer to output FILE. |
void xmlSecDSigReferenceCtxDebugXmlDump (xmlSecDSigReferenceCtxPtr dsigRefCtx
,FILE *output
);
Prints debug information about dsigRefCtx
to output
in output format.
dsigRefCtx |
the pointer to <dsig:Reference/> element processing context. |
|
output |
the pointer to output FILE. |
xmlSecPtrListId
xmlSecDSigReferenceCtxListGetKlass (void
);
The <dsig:Reference/> element processing contexts list klass.
XML Digital signature processing failure reason. The application should use
xmlSecDSigStatus
to find out the operation status first.
#define XMLSEC_DSIG_FLAGS_IGNORE_MANIFESTS 0x00000001
If this flag is set then <dsig:Manifests/> nodes will not be processed.
#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.
#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.
#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.
#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 { /* 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; xmlSecDSigFailureReason failureReason; 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.
the pointer to user data (xmlsec and xmlsec-crypto libraries never touches this). |
||
the XML Digital Signature processing flags. |
||
the XML Digital Signature processing flags. |
||
xmlSecKeyInfoCtx |
the reading key context. |
|
xmlSecKeyInfoCtx |
the writing key context (not used for signature verification). |
|
xmlSecTransformCtx |
the <dsig:SignedInfo/> node processing context. |
|
xmlSecTransformUriType |
the URI types allowed for <dsig:Reference/> node. |
|
xmlSecPtrListPtr |
the list of transforms allowed in <dsig:Reference/> node. |
|
xmlSecTransformCtxPreExecuteCallback |
the callback for <dsig:Reference/> node processing. |
|
the default signing method klass. |
||
the default c14n method klass. |
||
the default digest method klass. |
||
xmlSecKeyPtr |
the signature key; application may set signKey before calling xmlSecDSigCtxSign or xmlSecDSigCtxVerify functions. |
|
xmlSecTransformOperation |
the operation: sign or verify. |
|
xmlSecBufferPtr |
the pointer to signature (not valid for signature verification). |
|
xmlSecDSigStatus |
the <dsig:Signature/> processing status. |
|
xmlSecDSigFailureReason |
the detailed failure reason (if known); the application should check |
|
xmlSecTransformPtr |
the pointer to signature transform. |
|
xmlSecTransformPtr |
the pointer to c14n transform. |
|
xmlSecTransformPtr |
the pointer to binary buffer right before signature (valid only if XMLSEC_DSIG_FLAGS_STORE_SIGNATURE flag is set). |
|
the pointer to <dsig:SignatureValue/> node. |
||
the pointer to Id attribute of <dsig:Signature/> node. |
||
xmlSecPtrList |
the list of references in <dsig:SignedInfo/> node. |
|
xmlSecPtrList |
the list of references in <dsig:Manifest/> nodes. |
|
reserved for the future. |
||
reserved for the future. |
The possible <dsig:Reference/> node locations: in the <dsig:SignedInfo/> node or in the <dsig:Manifest/> node.
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.
the pointer to user data (xmlsec and xmlsec-crypto libraries never touches this). |
||
xmlSecDSigCtxPtr |
the pointer to "parent" <dsig:Signature/> processing context. |
|
xmlSecDSigReferenceOrigin |
the signature origin (<dsig:SignedInfo/> or <dsig:Manifest/>). |
|
xmlSecTransformCtx |
the reference processing transforms context. |
|
xmlSecTransformPtr |
the pointer to digest transform. |
|
xmlSecBufferPtr |
the pointer to digest result. |
|
xmlSecDSigStatus |
the reference processing status. |
|
xmlSecTransformPtr |
the pointer to binary buffer right before digest (valid only if either XMLSEC_DSIG_FLAGS_STORE_SIGNEDINFO_REFERENCES or XMLSEC_DSIG_FLAGS_STORE_MANIFEST_REFERENCES flags are set). |
|
the <dsig:Reference/> node ID attribute. |
||
the <dsig:Reference/> node URI attribute. |
||
the <dsig:Reference/> node Type attribute. |
||
reserved for the future. |
||
reserved for the future. |