# SignXml

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

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

{% tabs %}
{% tab title="Parameter: 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>:</li></ul><p>Input type.</p><p>Possible types are File and XmlString.</p><ul><li><code>XmlString</code>:</li></ul><p>Input type.</p><p>Possible types are File and XmlString.</p><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>:</li></ul><p>XML signing technique to use.</p><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>:</li></ul><p>How to sign the document.</p><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="Parameter: Output" %}

| Name                                 | Description                                                                                                                                                                                                                                                                      |
| ------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| OutputType : `XmlParamType`          | <p>Output to file or XML string?</p><p>Possible values:</p><ul><li><code>File</code>:</li></ul><p>Output to file or XML string?</p><ul><li><code>XmlString</code>:</li></ul><p>Output to file or XML string?</p><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="Parameter: 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>:</li></ul><p>Signature methods to be used with signing.</p><ul><li><code>RSASHA256</code>:</li></ul><p>Signature methods to be used with signing.</p><ul><li><code>RSASHA384</code>:</li></ul><p>Signature methods to be used with signing.</p><ul><li><code>RSASHA512</code>:</li></ul><p>Signature methods to be used with signing.</p><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>:</li></ul><p>Digest methods to be used.</p><ul><li><code>SHA256</code>:</li></ul><p>Digest methods to be used.</p><ul><li><code>SHA384</code>:</li></ul><p>Digest methods to be used.</p><ul><li><code>SHA512</code>:</li></ul><p>Digest methods to be used.</p><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 %}                              |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |

{% tab title="Result: SigningResult" %}

| 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> |
| {% endtab %}      |                                                                                                                                                               |
| {% endtabs %}     |                                                                                                                                                               |
