Details
struct xmlSecDigestTransform
struct xmlSecDigestTransform {
/* same as for xmlSecTransform but id type changed */
xmlSecDigestTransformId id;
xmlSecTransformStatus status;
int dontDestroy;
void *data;
/* xmlSecBinTransform specific */
int encode;
xmlSecDigestTransformPtr next;
xmlSecDigestTransformPtr prev;
void *binData;
/* xmlSecDigestTransform specific */
int pushModeEnabled;
unsigned char *digest;
size_t digestSize;
void *digestData;
}; |
The digests transform.
xmlSecDigestTransformId
typedef const struct _xmlSecDigestTransformIdStruct *xmlSecDigestTransformId; |
The digest transform id (xmlSecTransformTypeBinary type).
xmlSecDigestUpdateMethod ()
int (*xmlSecDigestUpdateMethod) (xmlSecDigestTransformPtr transform,
unsigned char *buffer,
size_t size); |
Updates digest with new chunk of data.
xmlSecDigestSignMethod ()
int (*xmlSecDigestSignMethod) (xmlSecDigestTransformPtr transform,
unsigned char **buffer,
size_t *size); |
Finalizes digest and returns result in allocated buffer (buffer, size).
The caller is responsible for freeing returned buffer with xmlFree() function.
xmlSecDigestVerifyMethod ()
int (*xmlSecDigestVerifyMethod) (xmlSecDigestTransformPtr transform,
unsigned char *buffer,
size_t size); |
Verifies digest with new chunk of data. The actual verification
status is set in status member of xmlSecDigestTransform structure.
xmlSecDigestSignNode ()
int xmlSecDigestSignNode (xmlSecTransformPtr transform,
xmlNodePtr valueNode,
int removeOldContent); |
Finalizes the digest result, signs it (if necessary), base64 encodes and
puts in the given node.
xmlSecDigestVerifyNode ()
int xmlSecDigestVerifyNode (xmlSecTransformPtr transform,
const xmlNodePtr valueNode); |
Reads the node content, base64 decodes it, finalizes the digest result and
verifies that it does match with the content of the node.
xmlSecDigestSetPushMode ()
void xmlSecDigestSetPushMode (xmlSecTransformPtr transform,
int enabled); |
Sets the push more flag. If push mode is enabled then the digest is
finalized and send to next transform when
1) read from previous transform returned 0
2) flush called
xmlSecDigestUpdate ()
int xmlSecDigestUpdate (xmlSecTransformPtr transform,
unsigned char *buffer,
size_t size); |
Updates data with the new chunk of data (wrapper for
xmlSecDigestTransformId::digestUpdate method).
xmlSecDigestSign ()
int xmlSecDigestSign (xmlSecTransformPtr transform,
unsigned char **buffer,
size_t *size); |
Finalizes digest and writes the result into the allocated
buffer (wrapper for xmlSecDigestTransformId::digestSign function).
Caller is responsble for freeing allocated buffer with xmlFree() function.
xmlSecDigestVerify ()
int xmlSecDigestVerify (xmlSecTransformPtr transform,
unsigned char *buffer,
size_t size); |
Checks the computed digest and the data in the input buffer
(wrapper for xmlSecDigestTransformId::digestVerify function).
xmlSecDigestTransformRead ()
int xmlSecDigestTransformRead (xmlSecBinTransformPtr transform,
unsigned char *buf,
size_t size); |
Reads all data from previos transform and digests it. If the
push mode enabled then the result is finalized and returned to the caller,
otherwise we return 0
xmlSecDigestTransformWrite ()
int xmlSecDigestTransformWrite (xmlSecBinTransformPtr transform,
unsigned char *buf,
size_t size); |
Adds new chunk of data to the digest.
xmlSecDigestTransformFlush ()
int xmlSecDigestTransformFlush (xmlSecBinTransformPtr transform); |
If the push mode enabled then the function finalizes the result,
writes it to the next transform and calls flush for it. Otherwise,
it just calls flush for next transform