- Home
- Download
- News
- Documentation

- FAQ
- Tutorial
- API reference
- Examples

- XML Digital Signature

- Online Verifier

- XML Encryption
- XML Canonicalization
- Reporting Bugs
- Mailing list
- Related
- Authors

# transforms

## Name

transforms -- Transform object definition.

## Synopsis

    #define             XMLSEC_TRANSFORM_BINARY_CHUNK
    xmlSecPtrListPtr    xmlSecTransformIdsGet               (void);
    intxmlSecTransformIdsInit              (void);
    voidxmlSecTransformIdsShutdown          (void);
    intxmlSecTransformIdsRegisterDefault   (void);
    intxmlSecTransformIdsRegister          (xmlSecTransformId id);
    enum                xmlSecTransformStatus;
    enum                xmlSecTransformMode;
    enum                xmlSecTransformOperation;
    typedef             xmlSecTransformUriType;
    #define             xmlSecTransformUriTypeNone
    #define             xmlSecTransformUriTypeEmpty
    #define             xmlSecTransformUriTypeSameDocument
    #define             xmlSecTransformUriTypeLocal
    #define             xmlSecTransformUriTypeRemote
    #define             xmlSecTransformUriTypeAny
    intxmlSecTransformUriTypeCheck         (xmlSecTransformUriType type,
                                                             const xmlChar *uri);
    typedef             xmlSecTransformDataType;
    #define             xmlSecTransformDataTypeUnknown
    #define             xmlSecTransformDataTypeBin
    #define             xmlSecTransformDataTypeXml
    typedef             xmlSecTransformUsage;
    #define             xmlSecTransformUsageUnknown
    #define             xmlSecTransformUsageDSigTransform
    #define             xmlSecTransformUsageC14NMethod
    #define             xmlSecTransformUsageDigestMethod
    #define             xmlSecTransformUsageSignatureMethod
    #define             xmlSecTransformUsageEncryptionMethod
    #define             xmlSecTransformUsageAny
    int                 (*xmlSecTransformCtxPreExecuteCallback)
                                                            (xmlSecTransformCtxPtr transformCtx);
    #define             XMLSEC_TRANSFORMCTX_FLAGS_USE_VISA3D_HACK
    struct              xmlSecTransformCtx;
    xmlSecTransformCtxPtr  xmlSecTransformCtxCreate         (void);
    voidxmlSecTransformCtxDestroy           (xmlSecTransformCtxPtr ctx);
    intxmlSecTransformCtxInitialize        (xmlSecTransformCtxPtr ctx);
    voidxmlSecTransformCtxFinalize          (xmlSecTransformCtxPtr ctx);
    voidxmlSecTransformCtxReset             (xmlSecTransformCtxPtr ctx);
    intxmlSecTransformCtxCopyUserPref      (xmlSecTransformCtxPtr dst,
                                                             xmlSecTransformCtxPtr src);
    intxmlSecTransformCtxSetUri            (xmlSecTransformCtxPtr ctx,
                                                             const xmlChar *uri,
                                                             xmlNodePtr hereNode);
    intxmlSecTransformCtxAppend            (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformPtr transform);
    intxmlSecTransformCtxPrepend           (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformPtr transform);
    xmlSecTransformPtrxmlSecTransformCtxCreateAndAppend   (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformId id);
    xmlSecTransformPtrxmlSecTransformCtxCreateAndPrepend  (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformId id);
    xmlSecTransformPtrxmlSecTransformCtxNodeRead          (xmlSecTransformCtxPtr ctx,
                                                             xmlNodePtr node,
                                                             xmlSecTransformUsage usage);
    intxmlSecTransformCtxNodesListRead     (xmlSecTransformCtxPtr ctx,
                                                             xmlNodePtr node,
                                                             xmlSecTransformUsage usage);
    intxmlSecTransformCtxPrepare           (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformDataType inputDataType);
    intxmlSecTransformCtxBinaryExecute     (xmlSecTransformCtxPtr ctx,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize);
    intxmlSecTransformCtxUriExecute        (xmlSecTransformCtxPtr ctx,
                                                             const xmlChar *uri);
    intxmlSecTransformCtxXmlExecute        (xmlSecTransformCtxPtr ctx,
                                                             xmlSecNodeSetPtr nodes);
    intxmlSecTransformCtxExecute           (xmlSecTransformCtxPtr ctx,
                                                             xmlDocPtr doc);
    voidxmlSecTransformCtxDebugDump         (xmlSecTransformCtxPtr ctx,
                                                             FILE *output);
    voidxmlSecTransformCtxDebugXmlDump      (xmlSecTransformCtxPtr ctx,
                                                             FILE *output);
    struct              xmlSecTransform;
    xmlSecTransformPtr  xmlSecTransformCreate               (xmlSecTransformId id);
    voidxmlSecTransformDestroy              (xmlSecTransformPtr transform);
    xmlSecTransformPtrxmlSecTransformNodeRead             (xmlNodePtr node,
                                                             xmlSecTransformUsage usage,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformPump                 (xmlSecTransformPtr left,
                                                             xmlSecTransformPtr right,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformSetKey               (xmlSecTransformPtr transform,
                                                             xmlSecKeyPtr key);
    intxmlSecTransformSetKeyReq            (xmlSecTransformPtr transform,
                                                             xmlSecKeyReqPtr keyReq);
    intxmlSecTransformVerify               (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformVerifyNodeContent    (xmlSecTransformPtr transform,
                                                             xmlNodePtr node,
                                                             xmlSecTransformCtxPtr transformCtx);
    xmlSecTransformDataType  xmlSecTransformGetDataType     (xmlSecTransformPtr transform,
                                                             xmlSecTransformMode mode,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformPushBin              (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             int final,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformPopBin               (xmlSecTransformPtr transform,
                                                             xmlSecByte *data,
                                                             xmlSecSize maxDataSize,
                                                             xmlSecSize *dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformPushXml              (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr nodes,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformPopXml               (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr *nodes,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformExecute              (xmlSecTransformPtr transform,
                                                             int last,
                                                             xmlSecTransformCtxPtr transformCtx);
    voidxmlSecTransformDebugDump            (xmlSecTransformPtr transform,
                                                             FILE *output);
    voidxmlSecTransformDebugXmlDump         (xmlSecTransformPtr transform,
                                                             FILE *output);
    #define             xmlSecTransformGetName              (transform)
    #define             xmlSecTransformIsValid              (transform)
    #define             xmlSecTransformCheckId              (transform,
                                                             i)
    #define             xmlSecTransformCheckSize            (transform,
                                                             size)
    intxmlSecTransformConnect              (xmlSecTransformPtr left,
                                                             xmlSecTransformPtr right,
                                                             xmlSecTransformCtxPtr transformCtx);
    voidxmlSecTransformRemove               (xmlSecTransformPtr transform);
    xmlSecTransformDataType  xmlSecTransformDefaultGetDataType
                                                            (xmlSecTransformPtr transform,
                                                             xmlSecTransformMode mode,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformDefaultPushBin       (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             int final,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformDefaultPopBin        (xmlSecTransformPtr transform,
                                                             xmlSecByte *data,
                                                             xmlSecSize maxDataSize,
                                                             xmlSecSize *dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformDefaultPushXml       (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr nodes,
                                                             xmlSecTransformCtxPtr transformCtx);
    intxmlSecTransformDefaultPopXml        (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr *nodes,
                                                             xmlSecTransformCtxPtr transformCtx);
    xmlOutputBufferPtrxmlSecTransformCreateOutputBuffer   (xmlSecTransformPtr transform,
                                                             xmlSecTransformCtxPtr transformCtx);
    xmlParserInputBufferPtrxmlSecTransformCreateInputBuffer
                                                            (xmlSecTransformPtr transform,
                                                             xmlSecTransformCtxPtr transformCtx);
    int                 (*xmlSecTransformInitializeMethod)  (xmlSecTransformPtr transform);
    void                (*xmlSecTransformFinalizeMethod)    (xmlSecTransformPtr transform);
    xmlSecTransformDataType  (*xmlSecTransformGetDataTypeMethod)
                                                            (xmlSecTransformPtr transform,
                                                             xmlSecTransformMode mode,
                                                             xmlSecTransformCtxPtr transformCtx);
    int                 (*xmlSecTransformNodeReadMethod)    (xmlSecTransformPtr transform,
                                                             xmlNodePtr node,
                                                             xmlSecTransformCtxPtr transformCtx);
    int                 (*xmlSecTransformNodeWriteMethod)   (xmlSecTransformPtr transform,
                                                             xmlNodePtr node,
                                                             xmlSecTransformCtxPtr transformCtx);
    int                 (*xmlSecTransformSetKeyRequirementsMethod)
                                                            (xmlSecTransformPtr transform,
                                                             xmlSecKeyReqPtr keyReq);
    int                 (*xmlSecTransformSetKeyMethod)      (xmlSecTransformPtr transform,
                                                             xmlSecKeyPtr key);
    int                 (*xmlSecTransformVerifyMethod)      (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);
    int                 (*xmlSecTransformPushBinMethod)     (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             int final,
                                                             xmlSecTransformCtxPtr transformCtx);
    int                 (*xmlSecTransformPopBinMethod)      (xmlSecTransformPtr transform,
                                                             xmlSecByte *data,
                                                             xmlSecSize maxDataSize,
                                                             xmlSecSize *dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);
    int                 (*xmlSecTransformPushXmlMethod)     (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr nodes,
                                                             xmlSecTransformCtxPtr transformCtx);
    int                 (*xmlSecTransformPopXmlMethod)      (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr *nodes,
                                                             xmlSecTransformCtxPtr transformCtx);
    int                 (*xmlSecTransformExecuteMethod)     (xmlSecTransformPtr transform,
                                                             int last,
                                                             xmlSecTransformCtxPtr transformCtx);
    struct              xmlSecTransformKlass;
    #define             xmlSecTransformKlassGetName         (klass)
    #define             xmlSecTransformIdListId
    xmlSecPtrListIdxmlSecTransformIdListGetKlass       (void);
    intxmlSecTransformIdListFind           (xmlSecPtrListPtr list,
                                                             xmlSecTransformId transformId);
    xmlSecTransformIdxmlSecTransformIdListFindByHref     (xmlSecPtrListPtr list,
                                                             const xmlChar *href,
                                                             xmlSecTransformUsage usage);
    xmlSecTransformIdxmlSecTransformIdListFindByName     (xmlSecPtrListPtr list,
                                                             const xmlChar *name,
                                                             xmlSecTransformUsage usage);
    voidxmlSecTransformIdListDebugDump      (xmlSecPtrListPtr list,
                                                             FILE *output);
    voidxmlSecTransformIdListDebugXmlDump   (xmlSecPtrListPtr list,
                                                             FILE *output);
    #define             xmlSecTransformIdUnknown
    #define             xmlSecTransformBase64Id
    xmlSecTransformIdxmlSecTransformBase64GetKlass       (void);
    voidxmlSecTransformBase64SetLineSize    (xmlSecTransformPtr transform,
                                                             xmlSecSize lineSize);
    #define             xmlSecTransformInclC14NId
    xmlSecTransformIdxmlSecTransformInclC14NGetKlass     (void);
    #define             xmlSecTransformInclC14NWithCommentsId
    xmlSecTransformIdxmlSecTransformInclC14NWithCommentsGetKlass
                                                            (void);
    #define             xmlSecTransformInclC14N11Id
    xmlSecTransformIdxmlSecTransformInclC14N11GetKlass   (void);
    #define             xmlSecTransformInclC14N11WithCommentsId
    xmlSecTransformIdxmlSecTransformInclC14N11WithCommentsGetKlass
                                                            (void);
    #define             xmlSecTransformExclC14NId
    xmlSecTransformIdxmlSecTransformExclC14NGetKlass     (void);
    #define             xmlSecTransformExclC14NWithCommentsId
    xmlSecTransformIdxmlSecTransformExclC14NWithCommentsGetKlass
                                                            (void);
    #define             xmlSecTransformEnvelopedId
    xmlSecTransformIdxmlSecTransformEnvelopedGetKlass    (void);
    #define             xmlSecTransformXPathId
    xmlSecTransformIdxmlSecTransformXPathGetKlass        (void);
    #define             xmlSecTransformXPath2Id
    xmlSecTransformIdxmlSecTransformXPath2GetKlass       (void);
    #define             xmlSecTransformXPointerId
    xmlSecTransformIdxmlSecTransformXPointerGetKlass     (void);
    intxmlSecTransformXPointerSetExpr      (xmlSecTransformPtr transform,
                                                             const xmlChar *expr,
                                                             xmlSecNodeSetType nodeSetType,
                                                             xmlNodePtr hereNode);
    #define             xmlSecTransformXsltId
    xmlSecTransformIdxmlSecTransformXsltGetKlass         (void);
    voidxmlSecTransformXsltSetDefaultSecurityPrefs
                                                            (xsltSecurityPrefsPtr sec);
    #define             xmlSecTransformRemoveXmlTagsC14NId
    xmlSecTransformIdxmlSecTransformRemoveXmlTagsC14NGetKlass
                                                            (void);
    #define             xmlSecTransformVisa3DHackId
    xmlSecTransformIdxmlSecTransformVisa3DHackGetKlass   (void);
    intxmlSecTransformVisa3DHackSetID      (xmlSecTransformPtr transform,
                                                             const xmlChar *id);

## Description

Transform object definition.

## Details

### XMLSEC_TRANSFORM_BINARY_CHUNK

    #define XMLSEC_TRANSFORM_BINARY_CHUNK                   64

The binary data chunks size. XMLSec processes binary data one chunk at a time. Changing this impacts xmlsec memory usage and performance.

### xmlSecTransformIdsGet ()

    xmlSecPtrListPtr    xmlSecTransformIdsGet               (void);

Gets global registered transform klasses list.

Returns : | the pointer to list of all registered transform klasses.

### xmlSecTransformIdsInit ()

    int                 xmlSecTransformIdsInit              (void);

Initializes the transform klasses. This function is called from the xmlSecInit function and the application should not call it directly.

Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformIdsShutdown ()

    void                xmlSecTransformIdsShutdown          (void);

Shuts down the keys data klasses. This function is called from the xmlSecShutdown function and the application should not call it directly.

### xmlSecTransformIdsRegisterDefault ()

    int                 xmlSecTransformIdsRegisterDefault   (void);

Registers default (implemented by XML Security Library) transform klasses: XPath transform, Base64 transform, ...

Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformIdsRegister ()

    int                 xmlSecTransformIdsRegister          (xmlSecTransformId id);

Registers `id` in the global list of transform klasses.

`id` : | the transform klass.
Returns : | 0 on success or a negative value if an error occurs.

### enum xmlSecTransformStatus

    typedef enum  {
        xmlSecTransformStatusNone = 0,
        xmlSecTransformStatusWorking,
        xmlSecTransformStatusFinished,
        xmlSecTransformStatusOk,
        xmlSecTransformStatusFail
    } xmlSecTransformStatus;

The transform execution status.

`xmlSecTransformStatusNone` | the status unknown.
`xmlSecTransformStatusWorking` | the transform is executed.
`xmlSecTransformStatusFinished` | the transform finished
`xmlSecTransformStatusOk` | the transform succeeded.
`xmlSecTransformStatusFail` | the transform failed (an error occur).

### enum xmlSecTransformMode

    typedef enum  {
        xmlSecTransformModeNone = 0,
        xmlSecTransformModePush,
        xmlSecTransformModePop
    } xmlSecTransformMode;

The transform operation mode

`xmlSecTransformModeNone` | the mode is unknown.
`xmlSecTransformModePush` | pushing data thru transform.
`xmlSecTransformModePop` | popping data from transform.

### enum xmlSecTransformOperation

    typedef enum  {
        xmlSecTransformOperationNone = 0,
        xmlSecTransformOperationEncode,
        xmlSecTransformOperationDecode,
        xmlSecTransformOperationSign,
        xmlSecTransformOperationVerify,
        xmlSecTransformOperationEncrypt,
        xmlSecTransformOperationDecrypt
    } xmlSecTransformOperation;

The transform operation.

`xmlSecTransformOperationNone` | the operation is unknown.
`xmlSecTransformOperationEncode` | the encode operation (for base64 transform).
`xmlSecTransformOperationDecode` | the decode operation (for base64 transform).
`xmlSecTransformOperationSign` | the sign or digest operation.
`xmlSecTransformOperationVerify` | the verification of signature or digest operation.
`xmlSecTransformOperationEncrypt` | the encryption operation.
`xmlSecTransformOperationDecrypt` | the decryption operation.

### xmlSecTransformUriType

    typedef unsigned int                            xmlSecTransformUriType;

URI transform type bit mask.

### xmlSecTransformUriTypeNone

    #define xmlSecTransformUriTypeNone              0x0000

The URI type is unknown or not set.

### xmlSecTransformUriTypeEmpty

    #define xmlSecTransformUriTypeEmpty             0x0001

The empty URI ("") type.

### xmlSecTransformUriTypeSameDocument

    #define xmlSecTransformUriTypeSameDocument      0x0002

The smae document ("#...") but not empty ("") URI type.

### xmlSecTransformUriTypeLocal

    #define xmlSecTransformUriTypeLocal             0x0004

The local URI ("file:///....") type.

### xmlSecTransformUriTypeRemote

    #define xmlSecTransformUriTypeRemote            0x0008

The remote URI type.

### xmlSecTransformUriTypeAny

    #define xmlSecTransformUriTypeAny               0xFFFF

Any URI type.

### xmlSecTransformUriTypeCheck ()

    int                 xmlSecTransformUriTypeCheck         (xmlSecTransformUriType type,
                                                             const xmlChar *uri);

Checks if `uri` matches expected type `type`.

`type` : | the expected URI type.
`uri` : | the uri for checking.
Returns : | 1 if `uri` matches `type`, 0 if not or a negative value if an error occurs.

### xmlSecTransformDataType

    typedef xmlSecByte                              xmlSecTransformDataType;

Transform data type bit mask.

### xmlSecTransformDataTypeUnknown

    #define xmlSecTransformDataTypeUnknown          0x0000

The transform data type is unknown or nor data expected.

### xmlSecTransformDataTypeBin

    #define xmlSecTransformDataTypeBin              0x0001

The binary transform data.

### xmlSecTransformDataTypeXml

    #define xmlSecTransformDataTypeXml              0x0002

The xml transform data.

### xmlSecTransformUsage

    typedef unsigned int                            xmlSecTransformUsage;

The transform usage bit mask.

### xmlSecTransformUsageUnknown

    #define xmlSecTransformUsageUnknown             0x0000

Transforms usage is unknown or undefined.

### xmlSecTransformUsageDSigTransform

    #define xmlSecTransformUsageDSigTransform       0x0001

Transform could be used in <dsig:Transform>.

### xmlSecTransformUsageC14NMethod

    #define xmlSecTransformUsageC14NMethod          0x0002

Transform could be used in <dsig:CanonicalizationMethod>.

### xmlSecTransformUsageDigestMethod

    #define xmlSecTransformUsageDigestMethod        0x0004

Transform could be used in <dsig:DigestMethod>.

### xmlSecTransformUsageSignatureMethod

    #define xmlSecTransformUsageSignatureMethod     0x0008

Transform could be used in <dsig:SignatureMethod>.

### xmlSecTransformUsageEncryptionMethod

    #define xmlSecTransformUsageEncryptionMethod    0x0010

Transform could be used in <enc:EncryptionMethod>.

### xmlSecTransformUsageAny

    #define xmlSecTransformUsageAny                 0xFFFF

Transform could be used for operation.

### xmlSecTransformCtxPreExecuteCallback ()

    int                 (*xmlSecTransformCtxPreExecuteCallback)
                                                            (xmlSecTransformCtxPtr transformCtx);

The callback called after creating transforms chain but before starting data processing. Application can use this callback to do additional transforms chain verification or modification and aborting transforms execution (if necessary).

`transformCtx` : | the pointer to transform's context.
Returns : | 0 on success and a negative value otherwise (in this case, transforms chain will not be executed and xmlsec processing stops).

### XMLSEC_TRANSFORMCTX_FLAGS_USE_VISA3D_HACK

    #define XMLSEC_TRANSFORMCTX_FLAGS_USE_VISA3D_HACK               0x00000001

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 xmlSecTransformCtx

    struct xmlSecTransformCtx {
        /* user settings */
        void*                                       userData;
        unsigned int                                flags;
        unsigned int                                flags2;
        xmlSecTransformUriType                      enabledUris;
        xmlSecPtrList                               enabledTransforms;
        xmlSecTransformCtxPreExecuteCallback        preExecCallback;

        /* results */
        xmlSecBufferPtr                             result;
        xmlSecTransformStatus                       status;
        xmlChar*                                    uri;
        xmlChar*                                    xptrExpr;
        xmlSecTransformPtr                          first;
        xmlSecTransformPtr                          last;

        /* for the future */
        void*                                       reserved0;
        void*                                       reserved1;
    };

The transform execution context.

void *`userData`; | the pointer to user data (xmlsec and xmlsec-crypto never touch this).
unsigned int `flags`; | the bit mask flags to control transforms execution (reserved for the future).
unsigned int `flags2`; | the bit mask flags to control transforms execution (reserved for the future).
xmlSecTransformUriType `enabledUris`; | the allowed transform data source uri types.
xmlSecPtrList `enabledTransforms`; | the list of enabled transforms; if list is empty (default) then all registered transforms are enabled.
xmlSecTransformCtxPreExecuteCallback `preExecCallback`; | the callback called after preparing transform chain and right before actual data processing; application can use this callback to change transforms parameters, insert additional transforms in the chain or do additional validation (and abort transform execution if needed).
xmlSecBufferPtr `result`; | the pointer to transforms result buffer.
xmlSecTransformStatus `status`; | the transforms chain processng status.
xmlChar *`uri`; | the data source URI without xpointer expression.
xmlChar *`xptrExpr`; | the xpointer expression from data source URI (if any).
xmlSecTransformPtr `first`; | the first transform in the chain.
xmlSecTransformPtr `last`; | the last transform in the chain.
void *`reserved0`; | reserved for the future.
void *`reserved1`; | reserved for the future.

### xmlSecTransformCtxCreate ()

    xmlSecTransformCtxPtr  xmlSecTransformCtxCreate         (void);

Creates transforms chain processing context. The caller is responsible for destroying returned object by calling xmlSecTransformCtxDestroy function.

Returns : | pointer to newly allocated context object or NULL if an error occurs.

### xmlSecTransformCtxDestroy ()

    void                xmlSecTransformCtxDestroy           (xmlSecTransformCtxPtr ctx);

Destroy context object created with xmlSecTransformCtxCreate function.

`ctx` : | the pointer to transforms chain processing context.

### xmlSecTransformCtxInitialize ()

    int                 xmlSecTransformCtxInitialize        (xmlSecTransformCtxPtr ctx);

Initializes transforms chain processing context. The caller is responsible for cleaning up returned object by calling xmlSecTransformCtxFinalize function.

`ctx` : | the pointer to transforms chain processing context.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformCtxFinalize ()

    void                xmlSecTransformCtxFinalize          (xmlSecTransformCtxPtr ctx);

Cleans up `ctx` object initialized with xmlSecTransformCtxInitialize function.

`ctx` : | the pointer to transforms chain processing context.

### xmlSecTransformCtxReset ()

    void                xmlSecTransformCtxReset             (xmlSecTransformCtxPtr ctx);

Resets transfroms context for new processing.

`ctx` : | the pointer to transforms chain processing context.

### xmlSecTransformCtxCopyUserPref ()

    int                 xmlSecTransformCtxCopyUserPref      (xmlSecTransformCtxPtr dst,
                                                             xmlSecTransformCtxPtr src);

Copies user settings from `src` context to `dst`.

`dst` : | the pointer to destination transforms chain processing context.
`src` : | the pointer to source transforms chain processing context.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxSetUri ()

    int                 xmlSecTransformCtxSetUri            (xmlSecTransformCtxPtr ctx,
                                                             const xmlChar *uri,
                                                             xmlNodePtr hereNode);

Parses uri and adds xpointer transforms if required.

The following examples demonstrate what the URI attribute identifies and how it is dereferenced (http://www.w3.org/TR/xmldsig-core/sec-ReferenceProcessingModel):

- URI="http://example.com/bar.xml" identifies the octets that represent the external resource 'http://example.com/bar.xml', that is probably an XML document given its file extension.

- URI="http://example.com/bar.xmlchapter1" identifies the element with ID attribute value 'chapter1' of the external XML resource 'http://example.com/bar.xml', provided as an octet stream. Again, for the sake of interoperability, the element identified as 'chapter1' should be obtained using an XPath transform rather than a URI fragment (barename XPointer resolution in external resources is not REQUIRED in this specification).

- URI="" identifies the node-set (minus any comment nodes) of the XML resource containing the signature

- URI="chapter1" identifies a node-set containing the element with ID attribute value 'chapter1' of the XML resource containing the signature. XML Signature (and its applications) modify this node-set to include the element plus all descendents including namespaces and attributes -- but not comments.

`ctx` : | the pointer to transforms chain processing context.
`uri` : | the URI.
`hereNode` : | the pointer to "here" node required by some XML transforms (may be NULL).
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxAppend ()

    int                 xmlSecTransformCtxAppend            (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformPtr transform);

Connects the `transform` to the end of the chain of transforms in the `ctx` (see xmlSecTransformConnect function for details).

`ctx` : | the pointer to transforms chain processing context.
`transform` : | the pointer to new transform.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxPrepend ()

    int                 xmlSecTransformCtxPrepend           (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformPtr transform);

Connects the `transform` to the beggining of the chain of transforms in the `ctx` (see xmlSecTransformConnect function for details).

`ctx` : | the pointer to transforms chain processing context.
`transform` : | the pointer to new transform.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxCreateAndAppend ()

    xmlSecTransformPtr  xmlSecTransformCtxCreateAndAppend   (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformId id);

Creaeates new transform and connects it to the end of the chain of transforms in the `ctx` (see xmlSecTransformConnect function for details).

`ctx` : | the pointer to transforms chain processing context.
`id` : | the new transform klass.
Returns : | pointer to newly created transform or NULL if an error occurs.

### xmlSecTransformCtxCreateAndPrepend ()

    xmlSecTransformPtr  xmlSecTransformCtxCreateAndPrepend  (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformId id);

Creaeates new transform and connects it to the end of the chain of transforms in the `ctx` (see xmlSecTransformConnect function for details).

`ctx` : | the pointer to transforms chain processing context.
`id` : | the new transform klass.
Returns : | pointer to newly created transform or NULL if an error occurs.

### xmlSecTransformCtxNodeRead ()

    xmlSecTransformPtr  xmlSecTransformCtxNodeRead          (xmlSecTransformCtxPtr ctx,
                                                             xmlNodePtr node,
                                                             xmlSecTransformUsage usage);

Reads the transform from the `node` and appends it to the current chain of transforms in `ctx`.

`ctx` : | the pointer to transforms chain processing context.
`node` : | the pointer to transform's node.
`usage` : | the transform's usage (signature, encryption, etc.).
Returns : | pointer to newly created transform or NULL if an error occurs.

### xmlSecTransformCtxNodesListRead ()

    int                 xmlSecTransformCtxNodesListRead     (xmlSecTransformCtxPtr ctx,
                                                             xmlNodePtr node,
                                                             xmlSecTransformUsage usage);

Reads transforms from the <dsig:Transform/> children of the `node` and appends them to the current transforms chain in `ctx` object.

`ctx` : | the pointer to transforms chain processing context.
`node` : | the pointer to <dsig:Transform/> nodes parent node.
`usage` : | the transform's usage (signature, encryption, etc.).
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxPrepare ()

    int                 xmlSecTransformCtxPrepare           (xmlSecTransformCtxPtr ctx,
                                                             xmlSecTransformDataType inputDataType);

Prepares the transform context for processing data of `inputDataType`.

`ctx` : | the pointer to transforms chain processing context.
`inputDataType` : | the expected input type.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxBinaryExecute ()

    int                 xmlSecTransformCtxBinaryExecute     (xmlSecTransformCtxPtr ctx,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize);

Processes binary data using transforms chain in the `ctx`.

`ctx` : | the pointer to transforms chain processing context.
`data` : | the input binary data buffer.
`dataSize` : | the input data size.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxUriExecute ()

    int                 xmlSecTransformCtxUriExecute        (xmlSecTransformCtxPtr ctx,
                                                             const xmlChar *uri);

Process binary data from the URI using transforms chain in `ctx`.

`ctx` : | the pointer to transforms chain processing context.
`uri` : | the URI.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxXmlExecute ()

    int                 xmlSecTransformCtxXmlExecute        (xmlSecTransformCtxPtr ctx,
                                                             xmlSecNodeSetPtr nodes);

Process `nodes` using transforms in the transforms chain in `ctx`.

`ctx` : | the pointer to transforms chain processing context.
`nodes` : | the input node set.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxExecute ()

    int                 xmlSecTransformCtxExecute           (xmlSecTransformCtxPtr ctx,
                                                             xmlDocPtr doc);

Executes transforms chain in `ctx`.

`ctx` : | the pointer to transforms chain processing context.
`doc` : | the pointer to input document.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformCtxDebugDump ()

    void                xmlSecTransformCtxDebugDump         (xmlSecTransformCtxPtr ctx,
                                                             FILE *output);

Prints transforms context debug information to `output`.

`ctx` : | the pointer to transforms chain processing context.
`output` : | the pointer to output FILE.

### xmlSecTransformCtxDebugXmlDump ()

    void                xmlSecTransformCtxDebugXmlDump      (xmlSecTransformCtxPtr ctx,
                                                             FILE *output);

Prints transforms context debug information to `output` in XML format.

`ctx` : | the pointer to transforms chain processing context.
`output` : | the pointer to output FILE.

### struct xmlSecTransform

    struct xmlSecTransform {
        xmlSecTransformId                   id;
        xmlSecTransformOperation            operation;
        xmlSecTransformStatus               status;
        xmlNodePtr                          hereNode;

        /* transforms chain */
        xmlSecTransformPtr                  next;
        xmlSecTransformPtr                  prev;

        /* binary data */
        xmlSecBuffer                        inBuf;
        xmlSecBuffer                        outBuf;

        /* xml data */
        xmlSecNodeSetPtr                    inNodes;
        xmlSecNodeSetPtr                    outNodes;

        /* reserved for the future */
        void*                               reserved0;
        void*                               reserved1;
    };

The transform structure.

xmlSecTransformId `id`; | the transform id (pointer to xmlSecTransformId).
xmlSecTransformOperation `operation`; | the transform's opertaion.
xmlSecTransformStatus `status`; | the current status.
xmlNodePtr `hereNode`; | the pointer to transform's <dsig:Transform /> node.
xmlSecTransformPtr `next`; | the pointer to next transform in the chain.
xmlSecTransformPtr `prev`; | the pointer to previous transform in the chain.
xmlSecBuffer `inBuf`; | the input binary data buffer.
xmlSecBuffer `outBuf`; | the output binary data buffer.
xmlSecNodeSetPtr `inNodes`; | the input XML nodes.
xmlSecNodeSetPtr `outNodes`; | the output XML nodes.
void *`reserved0`; | reserved for the future.
void *`reserved1`; | reserved for the future.

### xmlSecTransformCreate ()

    xmlSecTransformPtr  xmlSecTransformCreate               (xmlSecTransformId id);

Creates new transform of the `id` klass. The caller is responsible for destroying returned tansform using xmlSecTransformDestroy function.

`id` : | the transform id to create.
Returns : | pointer to newly created transform or NULL if an error occurs.

### xmlSecTransformDestroy ()

    void                xmlSecTransformDestroy              (xmlSecTransformPtr transform);

Destroys transform created with xmlSecTransformCreate function.

`transform` : | the pointer to transform.

### xmlSecTransformNodeRead ()

    xmlSecTransformPtr  xmlSecTransformNodeRead             (xmlNodePtr node,
                                                             xmlSecTransformUsage usage,
                                                             xmlSecTransformCtxPtr transformCtx);

Reads transform from the `node` as follows:

1) reads "Algorithm" attribute;

2) checks the lists of known and allowed transforms;

3) calls transform's create method;

4) calls transform's read transform node method.

`node` : | the pointer to the transform's node.
`usage` : | the transform usage (signature, encryption, ...).
`transformCtx` : | the transform's chaing processing context.
Returns : | pointer to newly created transform or NULL if an error occurs.

### xmlSecTransformPump ()

    int                 xmlSecTransformPump                 (xmlSecTransformPtr left,
                                                             xmlSecTransformPtr right,
                                                             xmlSecTransformCtxPtr transformCtx);

Pops data from `left` transform and pushes to `right` transform until no more data is available.

`left` : | the source pumping transform.
`right` : | the destination pumping transform.
`transformCtx` : | the transform's chaing processing context.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformSetKey ()

    int                 xmlSecTransformSetKey               (xmlSecTransformPtr transform,
                                                             xmlSecKeyPtr key);

Sets the transform's key.

`transform` : | the pointer to transform.
`key` : | the pointer to key.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformSetKeyReq ()

    int                 xmlSecTransformSetKeyReq            (xmlSecTransformPtr transform,
                                                             xmlSecKeyReqPtr keyReq);

Sets the key requirements for `transform` in the `keyReq`.

`transform` : | the pointer to transform.
`keyReq` : | the pointer to keys requirements object.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformVerify ()

    int                 xmlSecTransformVerify               (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);

Verifies the data with transform's processing results (for digest, HMAC and signature transforms). The verification result is stored in the status member of xmlSecTransform object.

`transform` : | the pointer to transform.
`data` : | the binary data for verification.
`dataSize` : | the data size.
`transformCtx` : | the transform's chaing processing context.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformVerifyNodeContent ()

    int                 xmlSecTransformVerifyNodeContent    (xmlSecTransformPtr transform,
                                                             xmlNodePtr node,
                                                             xmlSecTransformCtxPtr transformCtx);

Gets the `node` content, base64 decodes it and calls xmlSecTransformVerify function to verify binary results.

`transform` : | the pointer to transform.
`node` : | the pointer to node.
`transformCtx` : | the transform's chaing processing context.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformGetDataType ()

    xmlSecTransformDataType  xmlSecTransformGetDataType     (xmlSecTransformPtr transform,
                                                             xmlSecTransformMode mode,
                                                             xmlSecTransformCtxPtr transformCtx);

Gets transform input (`mode` is "push") or output (`mode` is "pop") data type (binary or XML).

`transform` : | the pointer to transform.
`mode` : | the data mode (push or pop).
`transformCtx` : | the transform's chaing processing context.
Returns : | the transform's data type for the `mode` operation.

### xmlSecTransformPushBin ()

    int                 xmlSecTransformPushBin              (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             int final,
                                                             xmlSecTransformCtxPtr transformCtx);

Process binary `data` and pushes results to next transform.

`transform` : | the pointer to transform object.
`data` : | the input binary data,
`dataSize` : | the input data size.
`final` : | the flag: if set to 1 then it's the last data chunk.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformPopBin ()

    int                 xmlSecTransformPopBin               (xmlSecTransformPtr transform,
                                                             xmlSecByte *data,
                                                             xmlSecSize maxDataSize,
                                                             xmlSecSize *dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);

Pops data from previous transform in the chain, processes data and returns result in the `data` buffer. The size of returned data is placed in the `dataSize`.

`transform` : | the pointer to transform object.
`data` : | the buffer to store result data.
`maxDataSize` : | the size of the buffer data.
`dataSize` : | the pointer to returned data size.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformPushXml ()

    int                 xmlSecTransformPushXml              (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr nodes,
                                                             xmlSecTransformCtxPtr transformCtx);

Processes `nodes` and pushes result to the next transform in the chain.

`transform` : | the pointer to transform object.
`nodes` : | the input nodes.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformPopXml ()

    int                 xmlSecTransformPopXml               (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr *nodes,
                                                             xmlSecTransformCtxPtr transformCtx);

Pops data from previous transform in the chain, processes the data and returns result in `nodes`.

`transform` : | the pointer to transform object.
`nodes` : | the pointer to store popinter to result nodes.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformExecute ()

    int                 xmlSecTransformExecute              (xmlSecTransformPtr transform,
                                                             int last,
                                                             xmlSecTransformCtxPtr transformCtx);

Executes transform (used by default popBin/pushBin/popXml/pushXml methods).

`transform` : | the pointer to transform.
`last` : | the flag: if set to 1 then it's the last data chunk.
`transformCtx` : | the transform's chaing processing context.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformDebugDump ()

    void                xmlSecTransformDebugDump            (xmlSecTransformPtr transform,
                                                             FILE *output);

Prints transform's debug information to `output`.

`transform` : | the pointer to transform.
`output` : | the pointer to output FILE.

### xmlSecTransformDebugXmlDump ()

    void                xmlSecTransformDebugXmlDump         (xmlSecTransformPtr transform,
                                                             FILE *output);

Prints transform's debug information to `output` in XML format.

`transform` : | the pointer to transform.
`output` : | the pointer to output FILE.

### xmlSecTransformGetName()

    #define             xmlSecTransformGetName(transform)

Macro. Returns transform name.

`transform` : | the pointer to transform.

### xmlSecTransformIsValid()

    #define             xmlSecTransformIsValid(transform)

Macro. Returns 1 if the `transform` is valid or 0 otherwise.

`transform` : | the pointer to transform.

### xmlSecTransformCheckId()

    #define             xmlSecTransformCheckId(transform, i)

Macro. Returns 1 if the `transform` is valid and has specified id `i` or 0 otherwise.

`transform` : | the pointer to transform.
`i` : | the transform id.

### xmlSecTransformCheckSize()

    #define             xmlSecTransformCheckSize(transform, size)

Macro. Returns 1 if the `transform` is valid and has at least `size` bytes or 0 otherwise.

`transform` : | the pointer to transform.
`size` : | the transform object size.

### xmlSecTransformConnect ()

    int                 xmlSecTransformConnect              (xmlSecTransformPtr left,
                                                             xmlSecTransformPtr right,
                                                             xmlSecTransformCtxPtr transformCtx);

If the data object is a node-set and the next transform requires octets, the signature application MUST attempt to convert the node-set to an octet stream using Canonical XML [XML-C14N].

The story is different if the right transform is base64 decode (http://www.w3.org/TR/xmldsig-core/sec-Base-64):

This transform requires an octet stream for input. If an XPath node-set (or sufficiently functional alternative) is given as input, then it is converted to an octet stream by performing operations logically equivalent to 1) applying an XPath transform with expression self::`text()`, then 2) taking the string-value of the node-set. Thus, if an XML element is identified by a barename XPointer in the Reference URI, and its content consists solely of base64 encoded character data, then this transform automatically strips away the start and end tags of the identified element and any of its descendant elements as well as any descendant comments and processing instructions. The output of this transform is an octet stream.

`left` : | the pointer to left (prev) transform.
`right` : | the pointer to right (next) transform.
`transformCtx` : | the transform's chaing processing context.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformRemove ()

    void                xmlSecTransformRemove               (xmlSecTransformPtr transform);

Removes `transform` from the chain.

`transform` : | the pointer to xmlSecTransform structure.

### xmlSecTransformDefaultGetDataType ()

    xmlSecTransformDataType  xmlSecTransformDefaultGetDataType
                                                            (xmlSecTransformPtr transform,
                                                             xmlSecTransformMode mode,
                                                             xmlSecTransformCtxPtr transformCtx);

Gets transform input (`mode` is "push") or output (`mode` is "pop") data type (binary or XML) by analyzing available pushBin/popBin/pushXml/popXml methods.

`transform` : | the pointer to transform.
`mode` : | the data mode (push or pop).
`transformCtx` : | the transform's chaing processing context.
Returns : | the transform's data type for the `mode` operation.

### xmlSecTransformDefaultPushBin ()

    int                 xmlSecTransformDefaultPushBin       (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             int final,
                                                             xmlSecTransformCtxPtr transformCtx);

Process binary `data` by calling transform's execute method and pushes results to next transform.

`transform` : | the pointer to transform object.
`data` : | the input binary data,
`dataSize` : | the input data size.
`final` : | the flag: if set to 1 then it's the last data chunk.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformDefaultPopBin ()

    int                 xmlSecTransformDefaultPopBin        (xmlSecTransformPtr transform,
                                                             xmlSecByte *data,
                                                             xmlSecSize maxDataSize,
                                                             xmlSecSize *dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);

Pops data from previous transform in the chain, processes data by calling transform's execute method and returns result in the `data` buffer. The size of returned data is placed in the `dataSize`.

`transform` : | the pointer to transform object.
`data` : | the buffer to store result data.
`maxDataSize` : | the size of the buffer data.
`dataSize` : | the pointer to returned data size.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformDefaultPushXml ()

    int                 xmlSecTransformDefaultPushXml       (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr nodes,
                                                             xmlSecTransformCtxPtr transformCtx);

Processes `nodes` by calling transform's execute method and pushes result to the next transform in the chain.

`transform` : | the pointer to transform object.
`nodes` : | the input nodes.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformDefaultPopXml ()

    int                 xmlSecTransformDefaultPopXml        (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr *nodes,
                                                             xmlSecTransformCtxPtr transformCtx);

Pops data from previous transform in the chain, processes the data by calling transform's execute method and returns result in `nodes`.

`transform` : | the pointer to transform object.
`nodes` : | the pointer to store popinter to result nodes.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformCreateOutputBuffer ()

    xmlOutputBufferPtr  xmlSecTransformCreateOutputBuffer   (xmlSecTransformPtr transform,
                                                             xmlSecTransformCtxPtr transformCtx);

Creates output buffer to write data to `transform`.

`transform` : | the pointer to transform.
`transformCtx` : | the pointer to transform context object.
Returns : | pointer to new output buffer or NULL if an error occurs.

### xmlSecTransformCreateInputBuffer ()

    xmlParserInputBufferPtr  xmlSecTransformCreateInputBuffer
                                                            (xmlSecTransformPtr transform,
                                                             xmlSecTransformCtxPtr transformCtx);

Creates input buffer to read data from `transform`.

`transform` : | the pointer to transform.
`transformCtx` : | the pointer to transform context object.
Returns : | pointer to new input buffer or NULL if an error occurs.

### xmlSecTransformInitializeMethod ()

    int                 (*xmlSecTransformInitializeMethod)  (xmlSecTransformPtr transform);

The transform specific initialization method.

`transform` : | the pointer to transform object.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformFinalizeMethod ()

    void                (*xmlSecTransformFinalizeMethod)    (xmlSecTransformPtr transform);

The transform specific destroy method.

`transform` : | the pointer to transform object.

### xmlSecTransformGetDataTypeMethod ()

    xmlSecTransformDataType  (*xmlSecTransformGetDataTypeMethod)
                                                            (xmlSecTransformPtr transform,
                                                             xmlSecTransformMode mode,
                                                             xmlSecTransformCtxPtr transformCtx);

The transform specific method to query information about transform data type in specified mode `mode`.

`transform` : | the pointer to transform object.
`mode` : | the mode.
`transformCtx` : | the pointer to transform context object.
Returns : | transform data type.

### xmlSecTransformNodeReadMethod ()

    int                 (*xmlSecTransformNodeReadMethod)    (xmlSecTransformPtr transform,
                                                             xmlNodePtr node,
                                                             xmlSecTransformCtxPtr transformCtx);

The transform specific method to read the transform data from the `node`.

`transform` : | the pointer to transform object.
`node` : | the pointer to <dsig:Transform/> node.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformNodeWriteMethod ()

    int                 (*xmlSecTransformNodeWriteMethod)   (xmlSecTransformPtr transform,
                                                             xmlNodePtr node,
                                                             xmlSecTransformCtxPtr transformCtx);

The transform specific method to write transform information to an XML node `node`.

`transform` : | the pointer to transform object.
`node` : | the pointer to <dsig:Transform/> node.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformSetKeyRequirementsMethod ()

    int                 (*xmlSecTransformSetKeyRequirementsMethod)
                                                            (xmlSecTransformPtr transform,
                                                             xmlSecKeyReqPtr keyReq);

Transform specific method to set transform's key requirements.

`transform` : | the pointer to transform object.
`keyReq` : | the pointer to key requirements structure.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformSetKeyMethod ()

    int                 (*xmlSecTransformSetKeyMethod)      (xmlSecTransformPtr transform,
                                                             xmlSecKeyPtr key);

The transform specific method to set the key for use.

`transform` : | the pointer to transform object.
`key` : | the pointer to key.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformVerifyMethod ()

    int                 (*xmlSecTransformVerifyMethod)      (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);

The transform specific method to verify transform processing results (used by digest and signature transforms). This method sets `status` member of the xmlSecTransform structure to either xmlSecTransformStatusOk if verification succeeded or xmlSecTransformStatusFail otherwise.

`transform` : | the pointer to transform object.
`data` : | the input buffer.
`dataSize` : | the size of input buffer `data`.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformPushBinMethod ()

    int                 (*xmlSecTransformPushBinMethod)     (xmlSecTransformPtr transform,
                                                             const xmlSecByte *data,
                                                             xmlSecSize dataSize,
                                                             int final,
                                                             xmlSecTransformCtxPtr transformCtx);

The transform specific method to process data from `data` and push result to the next transform in the chain.

`transform` : | the pointer to transform object.
`data` : | the input binary data,
`dataSize` : | the input data size.
`final` : | the flag: if set to 1 then it's the last data chunk.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformPopBinMethod ()

    int                 (*xmlSecTransformPopBinMethod)      (xmlSecTransformPtr transform,
                                                             xmlSecByte *data,
                                                             xmlSecSize maxDataSize,
                                                             xmlSecSize *dataSize,
                                                             xmlSecTransformCtxPtr transformCtx);

The transform specific method to pop data from previous transform in the chain and return result in the `data` buffer. The size of returned data is placed in the `dataSize`.

`transform` : | the pointer to transform object.
`data` : | the buffer to store result data.
`maxDataSize` : | the size of the buffer `data`.
`dataSize` : | the pointer to returned data size.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformPushXmlMethod ()

    int                 (*xmlSecTransformPushXmlMethod)     (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr nodes,
                                                             xmlSecTransformCtxPtr transformCtx);

The transform specific method to process `nodes` and push result to the next transform in the chain.

`transform` : | the pointer to transform object.
`nodes` : | the input nodes.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformPopXmlMethod ()

    int                 (*xmlSecTransformPopXmlMethod)      (xmlSecTransformPtr transform,
                                                             xmlSecNodeSetPtr *nodes,
                                                             xmlSecTransformCtxPtr transformCtx);

The transform specific method to pop data from previous transform in the chain, process the data and return result in `nodes`.

`transform` : | the pointer to transform object.
`nodes` : | the pointer to store popinter to result nodes.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value otherwise.

### xmlSecTransformExecuteMethod ()

    int                 (*xmlSecTransformExecuteMethod)     (xmlSecTransformPtr transform,
                                                             int last,
                                                             xmlSecTransformCtxPtr transformCtx);

Transform specific method to process a chunk of data.

`transform` : | the pointer to transform object.
`last` : | the flag: if set to 1 then it's the last data chunk.
`transformCtx` : | the pointer to transform context object.
Returns : | 0 on success or a negative value otherwise.

### struct xmlSecTransformKlass

    struct xmlSecTransformKlass {
        /* data */
        xmlSecSize                          klassSize;
        xmlSecSize                          objSize;
        const xmlChar*                      name;
        const xmlChar*                      href;
        xmlSecTransformUsage                usage;

        /* methods */
        xmlSecTransformInitializeMethod     initialize;
        xmlSecTransformFinalizeMethod       finalize;

        xmlSecTransformNodeReadMethod       readNode;
        xmlSecTransformNodeWriteMethod      writeNode;

        xmlSecTransformSetKeyRequirementsMethod     setKeyReq;
        xmlSecTransformSetKeyMethod         setKey;
        xmlSecTransformVerifyMethod         verify;
        xmlSecTransformGetDataTypeMethod    getDataType;

        xmlSecTransformPushBinMethod        pushBin;
        xmlSecTransformPopBinMethod         popBin;
        xmlSecTransformPushXmlMethod        pushXml;
        xmlSecTransformPopXmlMethod         popXml;

        /* low level method */
        xmlSecTransformExecuteMethod        execute;

        /* reserved for future */
        void*                               reserved0;
        void*                               reserved1;
    };

The transform klass desccription structure.

xmlSecSize `klassSize`; | the transform klass structure size.
xmlSecSize `objSize`; | the transform object size.
const xmlChar *`name`; | the transform's name.
const xmlChar *`href`; | the transform's identification string (href).
xmlSecTransformUsage `usage`; | the allowed transforms usages.
xmlSecTransformInitializeMethod `initialize`; | the initialization method.
xmlSecTransformFinalizeMethod `finalize`; | the finmalization (destroy) function.
xmlSecTransformNodeReadMethod `readNode`; | the XML node read method.
xmlSecTransformNodeWriteMethod `writeNode`; | the XML node write method.
xmlSecTransformSetKeyRequirementsMethod `setKeyReq`; | the set key requirements method.
xmlSecTransformSetKeyMethod `setKey`; | the set key method.
xmlSecTransformVerifyMethod `verify`; | the verify method (for digest and signature transforms).
xmlSecTransformGetDataTypeMethod `getDataType`; | the input/output data type query method.
xmlSecTransformPushBinMethod `pushBin`; | the binary data "push thru chain" processing method.
xmlSecTransformPopBinMethod `popBin`; | the binary data "pop from chain" procesing method.
xmlSecTransformPushXmlMethod `pushXml`; | the XML data "push thru chain" processing method.
xmlSecTransformPopXmlMethod `popXml`; | the XML data "pop from chain" procesing method.
xmlSecTransformExecuteMethod `execute`; | the low level data processing method used by default implementations of `pushBin`, `popBin`, `pushXml` and `popXml`.
void *`reserved0`; | reserved for the future.
void *`reserved1`; | reserved for the future.

### xmlSecTransformKlassGetName()

    #define             xmlSecTransformKlassGetName(klass)

Macro. Returns transform klass name.

`klass` : | the transofrm's klass.

### xmlSecTransformIdListId

    #define xmlSecTransformIdListId xmlSecTransformIdListGetKlass()

Transform klasses list klass.

### xmlSecTransformIdListGetKlass ()

    xmlSecPtrListId     xmlSecTransformIdListGetKlass       (void);

The transform id list klass.

Returns : | pointer to the transform id list klass.

### xmlSecTransformIdListFind ()

    int                 xmlSecTransformIdListFind           (xmlSecPtrListPtr list,
                                                             xmlSecTransformId transformId);

Lookups `dataId` in `list`.

`list` : | the pointer to transform ids list.
`transformId` : | the transform klass.
Returns : | 1 if `dataId` is found in the `list`, 0 if not and a negative value if an error occurs.

### xmlSecTransformIdListFindByHref ()

    xmlSecTransformId   xmlSecTransformIdListFindByHref     (xmlSecPtrListPtr list,
                                                             const xmlChar *href,
                                                             xmlSecTransformUsage usage);

Lookups data klass in the list with given `href` and `usage` in `list`.

`list` : | the pointer to transform ids list.
`href` : | the desired transform klass href.
`usage` : | the desired transform usage.
Returns : | transform klass is found and NULL otherwise.

### xmlSecTransformIdListFindByName ()

    xmlSecTransformId   xmlSecTransformIdListFindByName     (xmlSecPtrListPtr list,
                                                             const xmlChar *name,
                                                             xmlSecTransformUsage usage);

Lookups data klass in the list with given `name` and `usage` in `list`.

`list` : | the pointer to transform ids list.
`name` : | the desired transform klass name.
`usage` : | the desired transform usage.
Returns : | transform klass is found and NULL otherwise.

### xmlSecTransformIdListDebugDump ()

    void                xmlSecTransformIdListDebugDump      (xmlSecPtrListPtr list,
                                                             FILE *output);

Prints binary transform debug information to `output`.

`list` : | the pointer to transform ids list.
`output` : | the pointer to output FILE.

### xmlSecTransformIdListDebugXmlDump ()

    void                xmlSecTransformIdListDebugXmlDump   (xmlSecPtrListPtr list,
                                                             FILE *output);

Prints binary transform debug information to `output` in XML format.

`list` : | the pointer to transform ids list.
`output` : | the pointer to output FILE.

### xmlSecTransformIdUnknown

    #define xmlSecTransformIdUnknown                        ((xmlSecTransformId)NULL)

The "unknown" transform id (NULL).

### xmlSecTransformBase64Id

    #define             xmlSecTransformBase64Id

The base64 encode transform klass.

### xmlSecTransformBase64GetKlass ()

    xmlSecTransformId   xmlSecTransformBase64GetKlass       (void);

The Base64 transform klass (http://www.w3.org/TR/xmldsig-core/sec-Base-64). The normative specification for base64 decoding transforms is RFC 2045 (http://www.ietf.org/rfc/rfc2045.txt). The base64 Transform element has no content. The input is decoded by the algorithms. This transform is useful if an application needs to sign the raw data associated with the encoded content of an element.

Returns : | base64 transform id.

### xmlSecTransformBase64SetLineSize ()

    void                xmlSecTransformBase64SetLineSize    (xmlSecTransformPtr transform,
                                                             xmlSecSize lineSize);

Sets the max line size to `lineSize`.

`transform` : | the pointer to BASE64 encode transform.
`lineSize` : | the new max line size.

### xmlSecTransformInclC14NId

    #define             xmlSecTransformInclC14NId

The regular (inclusive) C14N without comments transform klass.

### xmlSecTransformInclC14NGetKlass ()

    xmlSecTransformId   xmlSecTransformInclC14NGetKlass     (void);

Inclusive (regular) canonicalization that omits comments transform klass (http://www.w3.org/TR/xmldsig-core/sec-c14nAlg and http://www.w3.org/TR/2001/REC-xml-c14n-20010315).

Returns : | c14n transform id.

### xmlSecTransformInclC14NWithCommentsId

    #define             xmlSecTransformInclC14NWithCommentsId

The regular (inclusive) C14N with comments transform klass.

### xmlSecTransformInclC14NWithCommentsGetKlass ()

    xmlSecTransformId   xmlSecTransformInclC14NWithCommentsGetKlass
                                                            (void);

Inclusive (regular) canonicalization that includes comments transform klass (http://www.w3.org/TR/xmldsig-core/sec-c14nAlg and http://www.w3.org/TR/2001/REC-xml-c14n-20010315).

Returns : | c14n with comments transform id.

### xmlSecTransformInclC14N11Id

    #define             xmlSecTransformInclC14N11Id

The regular (inclusive) C14N 1.1 without comments transform klass.

### xmlSecTransformInclC14N11GetKlass ()

    xmlSecTransformId   xmlSecTransformInclC14N11GetKlass   (void);

C14N version 1.1 (http://www.w3.org/TR/xml-c14n11)

Returns : | c14n v1.1 transform id.

### xmlSecTransformInclC14N11WithCommentsId

    #define             xmlSecTransformInclC14N11WithCommentsId

The regular (inclusive) C14N 1.1 with comments transform klass.

### xmlSecTransformInclC14N11WithCommentsGetKlass ()

    xmlSecTransformId   xmlSecTransformInclC14N11WithCommentsGetKlass
                                                            (void);

C14N version 1.1 (http://www.w3.org/TR/xml-c14n11) with comments

Returns : | c14n v1.1 with comments transform id.

### xmlSecTransformExclC14NId

    #define             xmlSecTransformExclC14NId

The exclusive C14N without comments transform klass.

### xmlSecTransformExclC14NGetKlass ()

    xmlSecTransformId   xmlSecTransformExclC14NGetKlass     (void);

Exclusive canoncicalization that ommits comments transform klass (http://www.w3.org/TR/xml-exc-c14n/).

Returns : | exclusive c14n transform id.

### xmlSecTransformExclC14NWithCommentsId

    #define             xmlSecTransformExclC14NWithCommentsId

The exclusive C14N with comments transform klass.

### xmlSecTransformExclC14NWithCommentsGetKlass ()

    xmlSecTransformId   xmlSecTransformExclC14NWithCommentsGetKlass
                                                            (void);

Exclusive canoncicalization that includes comments transform klass (http://www.w3.org/TR/xml-exc-c14n/).

Returns : | exclusive c14n with comments transform id.

### xmlSecTransformEnvelopedId

    #define             xmlSecTransformEnvelopedId

The "enveloped" transform klass.

### xmlSecTransformEnvelopedGetKlass ()

    xmlSecTransformId   xmlSecTransformEnvelopedGetKlass    (void);

The enveloped transform klass (http://www.w3.org/TR/xmldsig-core/sec-EnvelopedSignature):

An enveloped signature transform T removes the whole Signature element containing T from the digest calculation of the Reference element containing T. The entire string of characters used by an XML processor to match the Signature with the XML production element is removed. The output of the transform is equivalent to the output that would result from replacing T with an XPath transform containing the following XPath parameter element:

<XPath xmlns:dsig="&dsig;"> count(ancestor-or-self::dsig:Signature | `here()`/ancestor::dsig:Signature[1]) > count(ancestor-or-self::dsig:Signature)</XPath>

The input and output requirements of this transform are identical to those of the XPath transform, but may only be applied to a node-set from its parent XML document. Note that it is not necessary to use an XPath expression evaluator to create this transform. However, this transform MUST produce output in exactly the same manner as the XPath transform parameterized by the XPath expression above.

Returns : | enveloped transform id.

### xmlSecTransformXPathId

    #define             xmlSecTransformXPathId

The XPath transform klass.

### xmlSecTransformXPathGetKlass ()

    xmlSecTransformId   xmlSecTransformXPathGetKlass        (void);

The XPath transform evaluates given XPath expression and intersects the result with the previous nodes set. See http://www.w3.org/TR/xmldsig-core/sec-XPath for more details.

Returns : | XPath transform id.

### xmlSecTransformXPath2Id

    #define             xmlSecTransformXPath2Id

The XPath2 transform klass.

### xmlSecTransformXPath2GetKlass ()

    xmlSecTransformId   xmlSecTransformXPath2GetKlass       (void);

The XPath2 transform (http://www.w3.org/TR/xmldsig-filter2/).

Returns : | XPath2 transform klass.

### xmlSecTransformXPointerId

    #define             xmlSecTransformXPointerId

The XPointer transform klass.

### xmlSecTransformXPointerGetKlass ()

    xmlSecTransformId   xmlSecTransformXPointerGetKlass     (void);

The XPointer transform klass (http://www.ietf.org/internet-drafts/draft-eastlake-xmldsig-uri-02.txt).

Returns : | XPointer transform klass.

### xmlSecTransformXPointerSetExpr ()

    int                 xmlSecTransformXPointerSetExpr      (xmlSecTransformPtr transform,
                                                             const xmlChar *expr,
                                                             xmlSecNodeSetType nodeSetType,
                                                             xmlNodePtr hereNode);

Sets the XPointer expression for an XPointer `transform`.

`transform` : | the pointer to XPointer transform.
`expr` : | the XPointer expression.
`nodeSetType` : | the type of evaluated XPointer expression.
`hereNode` : | the pointer to "here" node.
Returns : | 0 on success or a negative value if an error occurs.

### xmlSecTransformXsltId

    #define             xmlSecTransformXsltId

The XSLT transform klass.

### xmlSecTransformXsltGetKlass ()

    xmlSecTransformId   xmlSecTransformXsltGetKlass         (void);

XSLT transform klass (http://www.w3.org/TR/xmldsig-core/sec-XSLT):

The normative specification for XSL Transformations is [XSLT]. Specification of a namespace-qualified stylesheet element, which MUST be the sole child of the Transform element, indicates that the specified style sheet should be used. Whether this instantiates in-line processing of local XSLT declarations within the resource is determined by the XSLT processing model; the ordered application of multiple stylesheet may require multiple Transforms. No special provision is made for the identification of a remote stylesheet at a given URI because it can be communicated via an xsl:include or xsl:import within the stylesheet child of the Transform.

This transform requires an octet stream as input. If the actual input is an XPath node-set, then the signature application should attempt to convert it to octets (apply Canonical XML]) as described in the Reference Processing Model (section 4.3.3.2).]

The output of this transform is an octet stream. The processing rules for the XSL style sheet or transform element are stated in the XSLT specification [XSLT]. We RECOMMEND that XSLT transform authors use an output method of xml for XML and HTML. As XSLT implementations do not produce consistent serializations of their output, we further RECOMMEND inserting a transform after the XSLT transform to canonicalize the output. These steps will help to ensure interoperability of the resulting signatures among applications that support the XSLT transform. Note that if the output is actually HTML, then the result of these steps is logically equivalent [XHTML].

Returns : | pointer to XSLT transform klass.

### xmlSecTransformXsltSetDefaultSecurityPrefs ()

    void                xmlSecTransformXsltSetDefaultSecurityPrefs
                                                            (xsltSecurityPrefsPtr sec);

Sets the new default security preferences. The xmlsec default security policy is to disable everything.

`sec` : | the new security preferences

### xmlSecTransformRemoveXmlTagsC14NId

    #define             xmlSecTransformRemoveXmlTagsC14NId

The "remove all xml tags" transform klass (used before base64 transforms).

### xmlSecTransformRemoveXmlTagsC14NGetKlass ()

    xmlSecTransformId   xmlSecTransformRemoveXmlTagsC14NGetKlass
                                                            (void);

The "remove xml tags" transform klass (http://www.w3.org/TR/xmldsig-core/sec-Base-64): Base64 transform requires an octet stream for input. If an XPath node-set (or sufficiently functional alternative) is given as input, then it is converted to an octet stream by performing operations logically equivalent to 1) applying an XPath transform with expression self::`text()`, then 2) taking the string-value of the node-set. Thus, if an XML element is identified by a barename XPointer in the Reference URI, and its content consists solely of base64 encoded character data, then this transform automatically strips away the start and end tags of the identified element and any of its descendant elements as well as any descendant comments and processing instructions. The output of this transform is an octet stream.

Returns : | "remove xml tags" transform id.

### xmlSecTransformVisa3DHackId

    #define             xmlSecTransformVisa3DHackId

Selects node subtree by given node id string. The only reason why we need this is Visa3D protocol. It doesn't follow XML/XPointer/XMLDSig specs and allows invalid XPointer expressions in the URI attribute. Since we couldn't evaluate such expressions thru XPath/XPointer engine, we need to have this hack here.

### xmlSecTransformVisa3DHackGetKlass ()

    xmlSecTransformId   xmlSecTransformVisa3DHackGetKlass   (void);

The Visa3DHack transform klass. The only reason why we need this is Visa3D protocol. It doesn't follow XML/XPointer/XMLDSig specs and allows invalid XPointer expressions in the URI attribute. Since we couldn't evaluate such expressions thru XPath/XPointer engine, we need to have this hack here.

Returns : | Visa3DHack transform klass.

### xmlSecTransformVisa3DHackSetID ()

    int                 xmlSecTransformVisa3DHackSetID      (xmlSecTransformPtr transform,
                                                             const xmlChar *id);

Sets the ID value for an Visa3DHack `transform`.

`transform` : | the pointer to Visa3DHack transform.
`id` : | the ID value.
Returns : | 0 on success or a negative value if an error occurs.