# Transforms Engine

**API Group:** `xmlsec_core_transforms`

Transforms engine — chaining, execution, and built-in transforms.

[XSLT transform](https://www.w3.org/TR/xmldsig-core1/#sec-XSLT) implementation.

XPath transform implementation.

XMLDsig and XMLEnc transforms.

Relationship transform implementation.

Key wrap helper functions (AES/DES/Camellia).

[Enveloped signature transform](https://www.w3.org/TR/xmldsig-core1/#sec-EnvelopedSignature) implementation.

C14N canonicalization transform implementation.

The [Transforms Element](http://www.w3.org/TR/xmldsig-core/#sec-Transforms) contains an ordered list of Transform elements; these describe how the signer obtained the data object that was digested. Schema Definition: 

```c
<elementname="Transforms"type="ds:TransformsType"/>
<complexTypename="TransformsType">
<sequence>
<elementref="ds:Transform"maxOccurs="unbounded"/>
</sequence>
</complexType>
<elementname="Transform"type="ds:TransformType"/>
<complexTypename="TransformType"mixed="true">
<choiceminOccurs="0"maxOccurs="unbounded">
<anynamespace="##other"processContents="lax"/>
<!--(1,1)elementsfrom(0,unbounded)namespaces-->
<elementname="XPath"type="string"/>
</choice>
<attributename="Algorithm"type="anyURI"use="required"/>
</complexType>
``` DTD: 

```c
<!ELEMENTTransforms(Transform+)>
<!ELEMENTTransform(#PCDATA|XPath%Transform.ANY;)*>
<!ATTLISTTransformAlgorithmCDATA#REQUIRED>
<!ELEMENTXPath(#PCDATA)>
```

## Macros

### `xmlSecTransformUriTypeNone`

*Defined as:* `0x0000`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L99)

The URI type is unknown or not set.

---

### `xmlSecTransformUriTypeEmpty`

*Defined as:* `0x0001`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L104)

The empty URI ("") type.

---

### `xmlSecTransformUriTypeSameDocument`

*Defined as:* `0x0002`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L110)

The same-document ("#...") non-empty URI type.

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

---

### `xmlSecTransformUriTypeLocal`

*Defined as:* `0x0004`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L115)

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

---

### `xmlSecTransformUriTypeRemote`

*Defined as:* `0x0008`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L120)

The remote URI type.

---

### `xmlSecTransformUriTypeAny`

*Defined as:* `0xFFFF`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L125)

Any URI type.

---

### `xmlSecTransformDataTypeUnknown`

*Defined as:* `0x0000`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L143)

The transform data type is unknown.

The transform data type is unknown or nor data expected.

---

### `xmlSecTransformDataTypeBin`

*Defined as:* `0x0001`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L148)

The binary transform data.

---

### `xmlSecTransformDataTypeXml`

*Defined as:* `0x0002`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L153)

The xml transform data.

---

### `xmlSecTransformUsageUnknown`

*Defined as:* `0x0000`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L168)

Transforms usage is unknown or undefined.

---

### `xmlSecTransformUsageDSigTransform`

*Defined as:* `0x0001`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L174)

Transform usable in dsig:Transform.

Transform could be used in <dsig:Transform/>.

---

### `xmlSecTransformUsageC14NMethod`

*Defined as:* `0x0002`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L180)

Transform usable in dsig:CanonicalizationMethod.

Transform could be used in <dsig:CanonicalizationMethod/>.

---

### `xmlSecTransformUsageDigestMethod`

*Defined as:* `0x0004`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L186)

Transform usable in dsig:DigestMethod.

Transform could be used in <dsig:DigestMethod/>.

---

### `xmlSecTransformUsageSignatureMethod`

*Defined as:* `0x0008`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L192)

Transform usable in dsig:SignatureMethod.

Transform could be used in <dsig:SignatureMethod/>.

---

### `xmlSecTransformUsageEncryptionMethod`

*Defined as:* `0x0010`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L198)

Transform usable in enc:EncryptionMethod.

Transform could be used in <enc:EncryptionMethod/>.

---

### `xmlSecTransformUsageKeyDerivationMethod`

*Defined as:* `0x0020`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L204)

Transform usable in enc11:KeyDerivationMethod.

Transform could be used in <enc11:KeyDerivationMethod/>.

---

### `xmlSecTransformUsageAgreementMethod`

*Defined as:* `0x0040`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L210)

Transform usable in enc11:AgreementMethod.

Transform could be used in <enc11:AgreementMethod/>.

---

### `xmlSecTransformUsageEncapsulationMechanism`

*Defined as:* `0x0080`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L218)

Transform usable in as:EncapsulationMechanism.

Transform is a KEM algorithm used in the <as:EncapsulationMechanism/> element: on encrypt it encapsulates a symmetric key and writes the ciphertext to CipherValue; on decrypt it reads the CipherValue and decapsulates to recover the key.

---

### `xmlSecTransformUsageAny`

*Defined as:* `0xFFFF`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L223)

Transform could be used for operation.

---

### `XMLSEC_TRANSFORMCTX_FLAGS_USE_VISA3D_HACK`

*Defined as:* `0x00000001`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L248)

Resolve URI ID references without XPointers (Visa3D hack).

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.

---

### `XMLSEC_TRANSFORMCTX_FLAGS_SUPPORT_ASN1_SIGNATURE_VALUES`

*Defined as:* `0x00000002`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L255)

Support ASN1 encoded ECDSA signature values.

If this flag is set then ASN1 encoded ECDSA signature values will be used (see [https://github.com/lsh123/xmlsec/issues/995](https://github.com/lsh123/xmlsec/issues/995)).

---

### `XMLSEC_TRANSFORM_FLAGS_USER_SPECIFIED`

*Defined as:* `0x00000001`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L347)

Transform was specified in the XML file.

If this flag is set then this transform was specified in the XML file (vs a transform added by the XMLSec library).

---

### `xmlSecTransformGetName`

*Defined as:* `((xmlSecTransformIsValid((transform))) ? \
          xmlSecTransformKlassGetName((transform)->id) : NULL)`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L435)

Macro. Returns transform name.

**Parameters:**

- `transform` — the pointer to transform.

---

### `xmlSecTransformIsValid`

*Defined as:* `((( transform ) != NULL) && \
         (( transform )->id != NULL) && \
         (( transform )->id->klassSize >= sizeof(xmlSecTransformKlass)) && \
         (( transform )->id->objSize >= sizeof(xmlSecTransform)) && \
         (( transform )->id->name != NULL))`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L444)

Macro. Returns 1 if `transform` is valid.

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

**Parameters:**

- `transform` — the pointer to transform.

---

### `xmlSecTransformCheckId`

*Defined as:* `(xmlSecTransformIsValid(( transform )) && \
        ((((const xmlSecTransformId) (( transform )->id))) == ( i )))`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L458)

Macro. Returns 1 if `transform` has id `i`.

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

**Parameters:**

- `transform` — the pointer to transform.
- `i` — the transform id.

---

### `xmlSecTransformCheckSize`

*Defined as:* `(xmlSecTransformIsValid(( transform )) && \
        ((( transform )->id->objSize) >= ( size )))`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L469)

Macro. Returns 1 if `transform` has at least `size` bytes.

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

**Parameters:**

- `transform` — the pointer to transform.
- `size` — the transform object size.

---

### `xmlSecTransformKlassGetName`

*Defined as:* `(((klass)) ? ((klass)->name) : NULL)`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L721)

Macro. Returns transform klass name.

**Parameters:**

- `klass` — the transform's klass.

---

### `xmlSecTransformIdListId`

*Defined as:* `xmlSecTransformIdListGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L732)

Transform klasses list klass.

---

### `xmlSecTransformIdUnknown`

*Defined as:* `((xmlSecTransformId)NULL)`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L756)

The "unknown" transform id (NULL).

---

### `xmlSecTransformBase64Id`

*Defined as:* `xmlSecTransformBase64GetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L761)

The base64 encode transform klass.

---

### `xmlSecTransformInclC14NId`

*Defined as:* `xmlSecTransformInclC14NGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L770)

The inclusive C14N without comments transform klass.

The regular (inclusive) C14N without comments transform klass.

---

### `xmlSecTransformInclC14NWithCommentsId`

*Defined as:* `xmlSecTransformInclC14NWithCommentsGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L778)

The inclusive C14N with comments transform klass.

The regular (inclusive) C14N with comments transform klass.

---

### `xmlSecTransformInclC14N11Id`

*Defined as:* `xmlSecTransformInclC14N11GetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L786)

The inclusive C14N 1.1 without comments transform klass.

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

---

### `xmlSecTransformInclC14N11WithCommentsId`

*Defined as:* `xmlSecTransformInclC14N11WithCommentsGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L794)

The inclusive C14N 1.1 with comments transform klass.

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

---

### `xmlSecTransformExclC14NId`

*Defined as:* `xmlSecTransformExclC14NGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L802)

The exclusive C14N without comments transform.

The exclusive C14N without comments transform klass.

---

### `xmlSecTransformExclC14NWithCommentsId`

*Defined as:* `xmlSecTransformExclC14NWithCommentsGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L809)

The exclusive C14N with comments transform klass.

---

### `xmlSecTransformEnvelopedId`

*Defined as:* `xmlSecTransformEnvelopedGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L816)

The "enveloped" transform klass.

---

### `xmlSecTransformXPathId`

*Defined as:* `xmlSecTransformXPathGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L823)

The XPath transform klass.

---

### `xmlSecTransformXPath2Id`

*Defined as:* `xmlSecTransformXPath2GetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L830)

The XPath2 transform klass.

---

### `xmlSecTransformXPointerId`

*Defined as:* `xmlSecTransformXPointerGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L837)

The XPointer transform klass.

---

### `xmlSecTransformRelationshipId`

*Defined as:* `xmlSecTransformRelationshipGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L847)

The Relationship transform klass.

---

### `xmlSecTransformXsltId`

*Defined as:* `xmlSecTransformXsltGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L856)

The XSLT transform klass.

---

### `xmlSecTransformRemoveXmlTagsC14NId`

*Defined as:* `xmlSecTransformRemoveXmlTagsC14NGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L866)

The 'remove all xml tags' transform klass.

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

---

### `xmlSecTransformVisa3DHackId`

*Defined as:* `xmlSecTransformVisa3DHackGetKlass()`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L877)

Selects node subtree by node id string (Visa3D hack).

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.

---

## Typedefs

### `xmlSecTransformKlass`

```c
typedef const struct _xmlSecTransformKlass xmlSecTransformKlass;
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L34)

The transform klass.

---

### `xmlSecTransformId`

```c
typedef const struct _xmlSecTransformKlass* xmlSecTransformId;
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L38)

Pointer to `xmlSecTransformKlass`.

---

### `xmlSecTransformUriType`

```c
typedef unsigned int xmlSecTransformUriType;
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L94)

URI transform type bit mask.

---

### `xmlSecTransformDataType`

```c
typedef xmlSecByte xmlSecTransformDataType;
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L137)

Transform data type bit mask.

---

### `xmlSecTransformUsage`

```c
typedef unsigned int xmlSecTransformUsage;
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L163)

The transform usage bit mask.

---

### `xmlSecTransformCtxPreExecuteCallback`

```c
typedef int(* xmlSecTransformCtxPreExecuteCallback) (xmlSecTransformCtxPtr transformCtx))(xmlSecTransformCtxPtr transformCtx);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L240)

Callback called before data processing to verify/modify transforms.

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). 

**Parameters:**

- `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).

---

### `xmlSecTransformInitializeMethod`

```c
typedef int(* xmlSecTransformInitializeMethod) (xmlSecTransformPtr transform))(xmlSecTransformPtr transform);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L529)

The transform specific initialization method.

**Parameters:**

- `transform` — the pointer to transform object.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformFinalizeMethod`

```c
typedef void(* xmlSecTransformFinalizeMethod) (xmlSecTransformPtr transform))(xmlSecTransformPtr transform);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L535)

The transform specific destroy method.

**Parameters:**

- `transform` — the pointer to transform object.

---

### `xmlSecTransformGetDataTypeMethod`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L546)

The transform specific method to query data type in a mode.

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

**Parameters:**

- `transform` — the pointer to transform object.
- `mode` — the mode.
- `transformCtx` — the pointer to transform context object.


**Returns:** transform data type.

---

### `xmlSecTransformNodeReadMethod`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L559)

The transform specific method to read data from XML node.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L571)

The transform specific method to write transform info to XML.

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

**Parameters:**

- `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`

```c
typedef int(* xmlSecTransformSetKeyRequirementsMethod) (xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq))(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L582)

Transform specific method to set key requirements.

Transform specific method to set transform's key requirements. 

**Parameters:**

- `transform` — the pointer to transform object.
- `keyReq` — the pointer to key requirements structure.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformSetKeyMethod`

```c
typedef int(* xmlSecTransformSetKeyMethod) (xmlSecTransformPtr transform, xmlSecKeyPtr key))(xmlSecTransformPtr transform, xmlSecKeyPtr key);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L592)

The transform specific method to set the key.

The transform specific method to set the key for use. 

**Parameters:**

- `transform` — the pointer to transform object.
- `key` — the pointer to key.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformVerifyMethod`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L607)

The transform specific method to verify processing results.

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. 

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L623)

The transform specific method to push binary data down the chain.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L640)

The transform specific method to pop binary data from the chain.

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`. 

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L654)

The transform specific method to push XML nodes down the chain.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L666)

The transform specific method to pop XML nodes from the chain.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L677)

Transform specific data processing method.

Transform specific method to process a chunk of data. 

**Parameters:**

- `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.

---

## Enumerations

### `xmlSecTransformStatus`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L56)

The transform execution status.

| Value | Initializer | Description |
|-------|-------------|-------------|
| `xmlSecTransformStatusNone` | `= 0` |  |
| `xmlSecTransformStatusWorking` | `` |  |
| `xmlSecTransformStatusFinished` | `` |  |
| `xmlSecTransformStatusOk` | `` |  |
| `xmlSecTransformStatusFail` | `` |  |

---

### `xmlSecTransformMode`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L67)

The transform operation mode.

| Value | Initializer | Description |
|-------|-------------|-------------|
| `xmlSecTransformModeNone` | `= 0` |  |
| `xmlSecTransformModePush` | `` |  |
| `xmlSecTransformModePop` | `` |  |

---

### `xmlSecTransformOperation`

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L76)

The transform operation.

| Value | Initializer | Description |
|-------|-------------|-------------|
| `xmlSecTransformOperationNone` | `= 0` |  |
| `xmlSecTransformOperationEncode` | `` |  |
| `xmlSecTransformOperationDecode` | `` |  |
| `xmlSecTransformOperationSign` | `` |  |
| `xmlSecTransformOperationVerify` | `` |  |
| `xmlSecTransformOperationEncrypt` | `` |  |
| `xmlSecTransformOperationDecrypt` | `` |  |

---

## Functions

### `xmlSecTransformIdsGet`

```c
xmlSecPtrListPtr xmlSecTransformIdsGet(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L45)

Gets global registered transform klasses list.

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

---

### `xmlSecTransformIdsInit`

```c
int xmlSecTransformIdsInit(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L46)

Initializes the transform klasses.

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`

```c
void xmlSecTransformIdsShutdown(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L47)

Shuts down the transform klasses.

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

---

### `xmlSecTransformIdsRegisterDefault`

```c
int xmlSecTransformIdsRegisterDefault(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L48)

Registers default XML Security Library transform klasses.

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`

```c
int xmlSecTransformIdsRegister(xmlSecTransformId id);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L49)

Registers a transform klass in the global list.

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

**Parameters:**

- `id` — the transform klass.


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

---

### `xmlSecTransformUriTypeCheck`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L127)

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

**Parameters:**

- `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.

---

### `xmlSecTransformCtxCreate`

```c
xmlSecTransformCtxPtr xmlSecTransformCtxCreate(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L287)

Creates a transforms chain processing context.

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`

```c
void xmlSecTransformCtxDestroy(xmlSecTransformCtxPtr ctx);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L288)

Destroys a transforms chain processing context.

Destroy context object created with `xmlSecTransformCtxCreate` function. 

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.

---

### `xmlSecTransformCtxInitialize`

```c
int xmlSecTransformCtxInitialize(xmlSecTransformCtxPtr ctx);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L289)

Initializes a transforms chain processing context.

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

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.


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

---

### `xmlSecTransformCtxFinalize`

```c
void xmlSecTransformCtxFinalize(xmlSecTransformCtxPtr ctx);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L290)

Cleans up a transforms chain processing context.

Cleans up `ctx` object initialized with `xmlSecTransformCtxInitialize` function. 

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.

---

### `xmlSecTransformCtxReset`

```c
void xmlSecTransformCtxReset(xmlSecTransformCtxPtr ctx);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L291)

Resets transforms context for new processing.

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.

---

### `xmlSecTransformCtxCopyUserPref`

```c
int xmlSecTransformCtxCopyUserPref(xmlSecTransformCtxPtr dst, xmlSecTransformCtxPtr src);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L292)

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

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L294)

Parses URI and adds xpointer transforms if required.

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](http://www.w3.org/TR/xmldsig-core/#sec-ReferenceProcessingModel)):

- `URI="` identifies the octets that represent the external resource ``, that is probably an XML document given its file extension.
- `URI="` identifies the element with ID attribute value 'chapter1' of the external XML resource ``, 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 descendants including namespaces and attributes – but not comments.

**Parameters:**

- `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`

```c
int xmlSecTransformCtxAppend(xmlSecTransformCtxPtr ctx, xmlSecTransformPtr transform);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L297)

Connects a transform to the end of the chain in `ctx`.

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

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `transform` — the pointer to new transform.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformCtxPrepend`

```c
int xmlSecTransformCtxPrepend(xmlSecTransformCtxPtr ctx, xmlSecTransformPtr transform);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L299)

Connects a transform to the beginning of the chain in `ctx`.

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

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `transform` — the pointer to new transform.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformCtxCreateAndAppend`

```c
xmlSecTransformPtr xmlSecTransformCtxCreateAndAppend(xmlSecTransformCtxPtr ctx, xmlSecTransformId id);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L301)

Creates a transform and appends it to the chain in `ctx`.

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

**Parameters:**

- `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`

```c
xmlSecTransformPtr xmlSecTransformCtxCreateAndPrepend(xmlSecTransformCtxPtr ctx, xmlSecTransformId id);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L303)

Creates a transform and prepends it to the chain in `ctx`.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L305)

Reads a transform from a node and appends it to the chain.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L308)

Reads transforms from <dsig:Transform/> children and appends to chain.

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

**Parameters:**

- `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`

```c
int xmlSecTransformCtxPrepare(xmlSecTransformCtxPtr ctx, xmlSecTransformDataType inputDataType);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L311)

Prepares the transform context for processing data.

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

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `inputDataType` — the expected input type.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformCtxBinaryExecute`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L313)

Processes binary data using transforms chain in `ctx`.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L316)

Processes binary data from URI using transforms chain in `ctx`.

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

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `uri` — the URI.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformCtxXmlExecute`

```c
int xmlSecTransformCtxXmlExecute(xmlSecTransformCtxPtr ctx, xmlSecNodeSetPtr nodes);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L318)

Processes nodes using transforms chain in `ctx`.

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

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `nodes` — the input node set.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformCtxExecute`

```c
int xmlSecTransformCtxExecute(xmlSecTransformCtxPtr ctx, xmlDocPtr doc);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L320)

Executes transforms chain in `ctx`.

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `doc` — the pointer to input document.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformCtxDebugDump`

```c
void xmlSecTransformCtxDebugDump(xmlSecTransformCtxPtr ctx, FILE *output);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L322)

Prints transforms context debug information to `output`.

Prints transforms context debug information to `output`. 

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `output` — the pointer to output FILE.

---

### `xmlSecTransformCtxDebugXmlDump`

```c
void xmlSecTransformCtxDebugXmlDump(xmlSecTransformCtxPtr ctx, FILE *output);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L324)

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

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

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `output` — the pointer to output FILE.

---

### `xmlSecTransformCtxGetDefaultBinaryChunkSize`

```c
xmlSecSize xmlSecTransformCtxGetDefaultBinaryChunkSize(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L328)

Gets the default binary chunk size.

Gets the binary chunk size. Increasing the chunk size improves XMLSec library performance at the expense of increased memory usage.

**Returns:** the current binary processing chunk size.

---

### `xmlSecTransformCtxSetDefaultBinaryChunkSize`

```c
void xmlSecTransformCtxSetDefaultBinaryChunkSize(xmlSecSize binaryChunkSize);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L329)

Sets the default binary chunk size.

Sets the default binary chunk size. Increasing the chunk size improves XMLSec library performance at the expense of increased memory usage. This function is not thread safe and should only be called during initialization. 

**Parameters:**

- `binaryChunkSize` — the new binary chunk size (must be greater than zero).

---

### `xmlSecTransformCtxGetDefaultMaxDepth`

```c
unsigned int xmlSecTransformCtxGetDefaultMaxDepth(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L331)

Gets the default max depth.

Gets the max depth for transform context execution.

**Returns:** the current max depth value.

---

### `xmlSecTransformCtxSetDefaultMaxDepth`

```c
void xmlSecTransformCtxSetDefaultMaxDepth(unsigned int maxDepth);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L332)

Sets the default max depth.

Sets the max depth for transform context execution. If set to 0, max depth check is disabled. This function is not thread safe and should only be called during initialization. 

**Parameters:**

- `maxDepth` — the new max depth value.

---

### `xmlSecTransformCtxExtraKeyDataGet`

```c
xmlSecKeyDataPtr xmlSecTransformCtxExtraKeyDataGet(xmlSecTransformCtxPtr ctx, xmlSecKeyDataId dataId);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L334)

Gets extra key data with a given `dataId` from the transforms context.

Returns the existing key data object with klass `dataId` from `ctx->extraKeyData` list, or NULL if the list is empty or no matching entry is found. 

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `dataId` — the requested key data klass.


**Returns:** pointer to key data or NULL if not found.

---

### `xmlSecTransformCtxExtraKeyDataEnsure`

```c
xmlSecKeyDataPtr xmlSecTransformCtxExtraKeyDataEnsure(xmlSecTransformCtxPtr ctx, xmlSecKeyDataId dataId);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L336)

Ensures extra key data with a given `dataId` exists in the transforms context.

Returns the existing key data object with klass `dataId` from `ctx->extraKeyData`, or creates and adds a new one if not present. The `ctx` takes ownership of any newly created key data. 

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `dataId` — the requested key data klass.


**Returns:** pointer to key data or NULL if an error occurs.

---

### `xmlSecTransformCtxExtraKeyDataAdopt`

```c
int xmlSecTransformCtxExtraKeyDataAdopt(xmlSecTransformCtxPtr ctx, xmlSecKeyDataPtr data);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L338)

Adopts key data into the transforms context extra key data list.

Adds `data` to `ctx->extraKeyData` list. The context takes ownership of `data`. Returns an error if key data of the same type already exists in the list. 

**Parameters:**

- `ctx` — the pointer to transforms chain processing context.
- `data` — the key data to adopt (must not be NULL).


**Returns:** 0 on success or a negative value if an error occurs (including when key data of the same type is already present).

---

### `xmlSecTransformCreate`

```c
xmlSecTransformPtr xmlSecTransformCreate(xmlSecTransformId id);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L386)

Creates a new transform of the specified klass.

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

**Parameters:**

- `id` — the transform id to create.


**Returns:** pointer to newly created transform or NULL if an error occurs.

---

### `xmlSecTransformDestroy`

```c
void xmlSecTransformDestroy(xmlSecTransformPtr transform);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L387)

Destroys a transform object.

Destroys transform created with `xmlSecTransformCreate` function. 

**Parameters:**

- `transform` — the pointer to transform.

---

### `xmlSecTransformNodeRead`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L388)

Reads a transform from a node.

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. 

**Parameters:**

- `node` — the pointer to the transform's node.
- `usage` — the transform usage (signature, encryption, ...).
- `transformCtx` — the transform's chain processing context.


**Returns:** pointer to newly created transform or NULL if an error occurs.

---

### `xmlSecTransformPump`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L391)

Pops data from left transform and pushes to right transform.

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

**Parameters:**

- `left` — the source pumping transform.
- `right` — the destination pumping transform.
- `transformCtx` — the transform's chain processing context.


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

---

### `xmlSecTransformSetKey`

```c
int xmlSecTransformSetKey(xmlSecTransformPtr transform, xmlSecKeyPtr key);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L394)

Sets the transform's key.

**Parameters:**

- `transform` — the pointer to transform.
- `key` — the pointer to key.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformSetKeyReq`

```c
int xmlSecTransformSetKeyReq(xmlSecTransformPtr transform, xmlSecKeyReqPtr keyReq);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L396)

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

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

**Parameters:**

- `transform` — the pointer to transform.
- `keyReq` — the pointer to keys requirements object.


**Returns:** 0 on success or a negative value otherwise.

---

### `xmlSecTransformVerify`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L398)

Verifies data against the transform's processing results.

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. 

**Parameters:**

- `transform` — the pointer to transform.
- `data` — the binary data for verification.
- `dataSize` — the data size.
- `transformCtx` — the transform's chain processing context.


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

---

### `xmlSecTransformVerifyNodeContent`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L402)

Verifies binary results from base64-decoded node content.

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

**Parameters:**

- `transform` — the pointer to transform.
- `node` — the pointer to node.
- `transformCtx` — the transform's chain processing context.


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

---

### `xmlSecTransformGetDataType`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L405)

Gets transform input or output data type (binary or XML).

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

**Parameters:**

- `transform` — the pointer to transform.
- `mode` — the data mode (push or pop).
- `transformCtx` — the transform's chain processing context.


**Returns:** the transform's data type for the `mode` operation.

---

### `xmlSecTransformPushBin`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L408)

Processes binary data and pushes results to next transform.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L413)

Pops data from previous transform, processes it, and returns result.

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`. 

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L418)

Processes nodes and pushes result to the next transform.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L421)

Pops data from previous transform, processes it, and returns nodes.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L424)

Executes a transform (used by default push/pop methods).

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

**Parameters:**

- `transform` — the pointer to transform.
- `last` — the flag: if set to 1 then it's the last data chunk.
- `transformCtx` — the transform's chain processing context.


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

---

### `xmlSecTransformDebugDump`

```c
void xmlSecTransformDebugDump(xmlSecTransformPtr transform, FILE *output);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L427)

Prints transform's debug information to `output`.

**Parameters:**

- `transform` — the pointer to transform.
- `output` — the pointer to output FILE.

---

### `xmlSecTransformDebugXmlDump`

```c
void xmlSecTransformDebugXmlDump(xmlSecTransformPtr transform, FILE *output);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L429)

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

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

**Parameters:**

- `transform` — the pointer to transform.
- `output` — the pointer to output FILE.

---

### `xmlSecTransformConnect`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L479)

Connects two transforms in the chain, inserting a conversion if needed.

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](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. 

**Parameters:**

- `left` — the pointer to left (prev) transform.
- `right` — the pointer to right (next) transform.
- `transformCtx` — the transform's chain processing context.


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

---

### `xmlSecTransformRemove`

```c
void xmlSecTransformRemove(xmlSecTransformPtr transform);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L482)

Removes `transform` from the chain.

**Parameters:**

- `transform` — the pointer to xmlSecTransform structure.

---

### `xmlSecTransformDefaultGetDataType`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L489)

Gets transform data type by analyzing available push/pop methods.

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

**Parameters:**

- `transform` — the pointer to transform.
- `mode` — the data mode (push or pop).
- `transformCtx` — the transform's chain processing context.


**Returns:** the transform's data type for the `mode` operation.

---

### `xmlSecTransformDefaultPushBin`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L492)

Processes binary data via execute method and pushes results.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L497)

Pops and processes data via execute method, returns result.

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`. 

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L502)

Processes nodes via execute method and pushes result.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L505)

Pops data, processes via execute method, and returns result nodes.

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

**Parameters:**

- `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`

```c
xmlOutputBufferPtr xmlSecTransformCreateOutputBuffer(xmlSecTransformPtr transform, xmlSecTransformCtxPtr transformCtx);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L514)

Creates an output buffer to write data to `transform`.

Creates output buffer to write data to `transform`. 

**Parameters:**

- `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`

```c
xmlParserInputBufferPtr xmlSecTransformCreateInputBuffer(xmlSecTransformPtr transform, xmlSecTransformCtxPtr transformCtx);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L516)

Creates an input buffer to read data from `transform`.

Creates input buffer to read data from `transform`. 

**Parameters:**

- `transform` — the pointer to transform.
- `transformCtx` — the pointer to transform context object.


**Returns:** pointer to new input buffer or NULL if an error occurs.

---

### `xmlSecTransformIdListGetKlass`

```c
xmlSecPtrListId xmlSecTransformIdListGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L733)

The transform id list klass.

**Returns:** pointer to the transform id list klass.

---

### `xmlSecTransformIdListFind`

```c
int xmlSecTransformIdListFind(xmlSecPtrListPtr list, xmlSecTransformId transformId);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L734)

Lookups `dataId` in `list`.

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L736)

Looks up a transform klass by href and usage in the list.

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

**Parameters:**

- `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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L739)

Looks up a transform klass by name and usage in the list.

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

**Parameters:**

- `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`

```c
void xmlSecTransformIdListDebugDump(xmlSecPtrListPtr list, FILE *output);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L742)

Prints transform ids list debug information to `output`.

Prints binary transform debug information to `output`. 

**Parameters:**

- `list` — the pointer to transform ids list.
- `output` — the pointer to output FILE.

---

### `xmlSecTransformIdListDebugXmlDump`

```c
void xmlSecTransformIdListDebugXmlDump(xmlSecPtrListPtr list, FILE *output);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L744)

Prints transform ids list debug information to `output` in XML format.

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

**Parameters:**

- `list` — the pointer to transform ids list.
- `output` — the pointer to output FILE.

---

### `xmlSecTransformBase64GetKlass`

```c
xmlSecTransformId xmlSecTransformBase64GetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L763)

Gets the Base64 transform klass.

The Base64 transform klass ([http://www.w3.org/TR/xmldsig-core/#sec-Base-64](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](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`

```c
void xmlSecTransformBase64SetLineSize(xmlSecTransformPtr transform, xmlSecSize lineSize);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L764)

Sets the max line size to `lineSize`.

**Parameters:**

- `transform` — the pointer to BASE64 encode transform.
- `lineSize` — the new max line size.

---

### `xmlSecTransformInclC14NGetKlass`

```c
xmlSecTransformId xmlSecTransformInclC14NGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L772)

Gets the inclusive C14N transform klass.

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

**Returns:** c14n transform id.

---

### `xmlSecTransformInclC14NWithCommentsGetKlass`

```c
xmlSecTransformId xmlSecTransformInclC14NWithCommentsGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L780)

Gets the inclusive C14N with comments transform klass.

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

**Returns:** c14n with comments transform id.

---

### `xmlSecTransformInclC14N11GetKlass`

```c
xmlSecTransformId xmlSecTransformInclC14N11GetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L788)

Gets the C14N v1.1 transform klass.

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

**Returns:** c14n v1.1 transform id.

---

### `xmlSecTransformInclC14N11WithCommentsGetKlass`

```c
xmlSecTransformId xmlSecTransformInclC14N11WithCommentsGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L796)

Gets the C14N v1.1 with comments transform klass.

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

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

---

### `xmlSecTransformExclC14NGetKlass`

```c
xmlSecTransformId xmlSecTransformExclC14NGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L804)

Gets the exclusive C14N transform klass.

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

**Returns:** exclusive c14n transform id.

---

### `xmlSecTransformExclC14NWithCommentsGetKlass`

```c
xmlSecTransformId xmlSecTransformExclC14NWithCommentsGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L811)

Gets the exclusive C14N with comments transform klass.

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

**Returns:** exclusive c14n with comments transform id.

---

### `xmlSecTransformEnvelopedGetKlass`

```c
xmlSecTransformId xmlSecTransformEnvelopedGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L818)

Gets the enveloped signature transform klass.

The enveloped transform klass ([http://www.w3.org/TR/xmldsig-core/#sec-EnvelopedSignature](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:

```c
<XPathxmlns: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.

---

### `xmlSecTransformXPathGetKlass`

```c
xmlSecTransformId xmlSecTransformXPathGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L825)

Gets the XPath transform klass.

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](http://www.w3.org/TR/xmldsig-core/#sec-XPath) for more details. 

**Returns:** XPath transform id.

---

### `xmlSecTransformXPath2GetKlass`

```c
xmlSecTransformId xmlSecTransformXPath2GetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L832)

Gets the XPath2 transform klass.

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

**Returns:** XPath2 transform klass.

---

### `xmlSecTransformXPointerGetKlass`

```c
xmlSecTransformId xmlSecTransformXPointerGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L839)

Gets the XPointer transform klass.

The XPointer transform klass ([https://www.rfc-editor.org/rfc/rfc9231.html](https://www.rfc-editor.org/rfc/rfc9231.html)). 

**Returns:** XPointer transform klass.

---

### `xmlSecTransformXPointerSetExpr`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L840)

Sets the XPointer expression for a transform.

Sets the XPointer expression for an XPointer `transform`. 

**Parameters:**

- `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.

---

### `xmlSecTransformRelationshipGetKlass`

```c
xmlSecTransformId xmlSecTransformRelationshipGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L849)

Gets the Relationship transform klass.

**Returns:** Relationship transform klass.

---

### `xmlSecTransformXsltGetKlass`

```c
xmlSecTransformId xmlSecTransformXsltGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L858)

Gets the XSLT transform klass.

XSLT transform klass ([http://www.w3.org/TR/xmldsig-core/#sec-XSLT](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`

```c
void xmlSecTransformXsltSetDefaultSecurityPrefs(xsltSecurityPrefsPtr sec);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L859)

Sets the default XSLT security preferences.

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

**Parameters:**

- `sec` — the new security preferences

---

### `xmlSecTransformRemoveXmlTagsC14NGetKlass`

```c
xmlSecTransformId xmlSecTransformRemoveXmlTagsC14NGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L868)

Gets the 'remove xml tags' transform klass.

The "remove xml tags" transform klass ([http://www.w3.org/TR/xmldsig-core/#sec-Base-64](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.

---

### `xmlSecTransformVisa3DHackGetKlass`

```c
xmlSecTransformId xmlSecTransformVisa3DHackGetKlass(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L879)

Gets the Visa3DHack transform klass.

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`

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

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L880)

Sets the ID value for an Visa3DHack `transform`.

**Parameters:**

- `transform` — the pointer to Visa3DHack transform.
- `id` — the ID value.


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

---

### `xmlSecTransformHmacGetMinOutputBitsSize`

```c
xmlSecSize xmlSecTransformHmacGetMinOutputBitsSize(void);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L892)

Gets the minimum size in bits for HMAC output.

**Returns:** the min HMAC output size in bits.

---

### `xmlSecTransformHmacSetMinOutputBitsSize`

```c
void xmlSecTransformHmacSetMinOutputBitsSize(xmlSecSize val);
```

*Source:* [include/xmlsec/transforms.h](https://github.com/lsh123/xmlsec/blob/1.3.12/include/xmlsec/transforms.h#L893)

Sets the min HMAC output size in bits.

Sets the min HMAC output size in bits. Low value for min output size might create a security vulnerability and is not recommended. 

**Parameters:**

- `val` — the new min hmac output size in bits.

---
