> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/xml/signxml.md).

# SignXml

Sign an XML document.

Task version: 1.3.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Xml2/tree/main/Frends.XML.SignXml>

## Task Parameters

{% tabs %}
{% tab title="Input" %}

| Name                                    | Description                                                                                                                                                                                                                                                             |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| XmlInputType : `XmlParamType`           | <p>Input type.</p><p>Possible types are File and XmlString.</p><p>Possible values:</p><ul><li><code>File</code>: Represents a file.</li><li><code>XmlString</code>: Represents an XML string.</li></ul><p><br>Default: <code>-</code><br>Example: <code>File</code></p> |
| XmlFilePath : `String`                  | <p>Path to XML document to sign.</p><p><br>Default: <code>c:\temp\document.xml</code><br>Example: <code>c:\temp\document.xml</code></p>                                                                                                                                 |
| Xml : `String`                          | <p>Input type.</p><p>Possible types are File and XmlString.</p><p><br>Default: <code>123</code><br>Example: <code>File</code></p>                                                                                                                                       |
| XmlEnvelopingType : `XmlEnvelopingType` | <p>XML signing technique to use.</p><p>Possible values:</p><ul><li><code>XmlEnvelopedSignature</code>: Uses an enveloped XML signature.</li></ul><p><br>Default: <code>-</code><br>Example: <code>XmlEnvelopedSignature</code></p>                                      |
| SigningStrategy : `SigningStrategyType` | <p>How to sign the document.</p><p>Possible values:</p><ul><li><code>PrivateKeyCertificate</code>: Uses a private key certificate for signing.</li></ul><p><br>Default: <code>-</code><br>Example: <code>PrivateKeyCertificate</code></p>                               |
| CertificatePath : `String`              | <p>Path to certificate with private key.</p><p><br>Default: <code>c:\certificates\signingcertificate.pfx</code><br>Example: <code>c:\certificates\signingcertificate.pfx</code></p>                                                                                     |
| 🗝PrivateKeyPassword : `String`         | <p>Private key password.</p><p><br>Default: <code>-</code><br>Example: <code>password123</code></p>                                                                                                                                                                     |
| {% endtab %}                            |                                                                                                                                                                                                                                                                         |

{% tab title="Output" %}

| Name                                 | Description                                                                                                                                                                                                                                  |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OutputType : `XmlParamType`          | <p>Output to file or XML string?</p><p>Possible values:</p><ul><li><code>File</code>: Represents a file.</li><li><code>XmlString</code>: Represents an XML string.</li></ul><p><br>Default: <code>-</code><br>Example: <code>File</code></p> |
| OutputFilePath : `String`            | <p>A filepath for the output XML.</p><p><br>Default: <code>c:\temp\signedOutput.xml</code><br>Example: <code>c:\temp\signedOutput.xml</code></p>                                                                                             |
| OutputEncoding : `String`            | <p>The encoding for the output file.</p><p><br>Default: <code>UTF-8</code><br>Example: <code>UTF-8</code></p>                                                                                                                                |
| AddSignatureToSourceFile : `Boolean` | <p>If source is file, then you can add signature to it.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p>                                                                                                                  |
| {% endtab %}                         |                                                                                                                                                                                                                                              |

{% tab title="Options" %}

| Name                                      | Description                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| IncludeComments : `Boolean`               | <p>Switch to include comments.</p><p><br>Default: <code>-</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                            |
| PreserveWhitespace : `Boolean`            | <p>Should whitespace be preserved when loading the XML?</p><p><br>Default: <code>-</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                  |
| XmlSignatureMethod : `XmlSignatureMethod` | <p>Signature methods to be used with signing.</p><p>Possible values:</p><ul><li><code>RSASHA1</code>: RSA with SHA-1.</li><li><code>RSASHA256</code>: RSA with SHA-256.</li><li><code>RSASHA384</code>: RSA with SHA-384.</li><li><code>RSASHA512</code>: RSA with SHA-512.</li></ul><p><br>Default: <code>-</code><br>Example: <code>RSASHA1</code></p>      |
| DigestMethod : `DigestMethod`             | <p>Digest methods to be used.</p><p>Possible values:</p><ul><li><code>SHA1</code>: SHA-1 hashing algorithm.</li><li><code>SHA256</code>: SHA-256 hashing algorithm.</li><li><code>SHA384</code>: SHA-384 hashing algorithm.</li><li><code>SHA512</code>: SHA-512 hashing algorithm.</li></ul><p><br>Default: <code>-</code><br>Example: <code>SHA1</code></p> |
| TransformMethods : `TransformMethod[]`    | <p>Transform methods to be used.</p><p><br>Default: <code>-</code><br>Example: <code>\[DsigC14, DsigC14WithComments]</code></p>                                                                                                                                                                                                                               |
| {% endtab %}                              |                                                                                                                                                                                                                                                                                                                                                               |
| {% endtabs %}                             |                                                                                                                                                                                                                                                                                                                                                               |

## Task Result

| Name              | Description                                                                                                                                                   |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Result : `String` | <p>If output type is file, this will be a filepath. Otherwise, this will be the signed XML as string.<br>Example: <code>c:\temp\signedDocument.xml</code></p> |

## Task Changelog

Changelog for Task Frends.XML.SignXml.

### \[1.3.0] - 2026-07-14

#### Changed

* Updated outdated repository URLs

### \[1.2.0] - 2025-07-10

#### Changed

* Update documentation link

### \[1.1.0] - 2025-03-25

#### Changed

* Update packages: System.ComponentModel.Annotations 4.7.0 -> 5.0.0 System.Security.Cryptography.Xml 8.0.1 -> 9.0.3 coverlet.collector 3.1.2 -> 6.0.4 Microsoft.NET.Test.Sdk 16.6.1 -> 17.13.0 nunit 3.12.0 -> 4.3.2 NUnit3TestAdapter 3.17.0 -> 5.0.0

### \[1.0.0] - 2024-06-13

#### Changed

* Initial implementation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.frends.com/tasks/tasks/xml/signxml.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
