> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/android/digital-signature/digi-sig-tool.md).

# Using digital signature tool in Android

Sign documents with ease using the DigitalSignature tool in the Tools package. Learn how to enable certificate-based signatures and save signed documents securely. Perfect for PDF viewing and signing.

{% hint style="warning" %}
For Android, available in the full version of the library only. See [Apryse full or standard?](/xamarin/get-started/faq/full-vs-standard.md)
{% endhint %}

The Tools package comes with a basic [`DigitalSignature`](https://sdk.apryse.com/api/android/javadoc/reference/com/pdftron/pdf/tools/DigitalSignature.html) tool that allows signing with a specific keystore and password. The `DigitalSignature` tool can be used with the UI components such as [DocumentActivity](/android/open-save-document/open.md) and [PdfViewCtrlTabHostFragment2](/android/open-save-document/open.md). You can also use the tool with [PDFViewCtrl](/android/open-save-document/open/view.md) through [ToolManager](/android/ui-customization/set-tool-to-toolmanager.md).

![](https://226546913-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0QItsdFBmuuL9ezHimHy%2Fuploads%2Fgit-blob-285fb3d877e22a706d94c5f900a1c1e65628d32b%2F15b1cabeb18061e135cdf37d1c41e2436e44cc3b-1080x2220.gif?alt=media)

By default, the signature tool does not sign with a certificate. Certificate-based signatures can be enabled using `ToolManagerBuilder` which will add a certificate picker and password input field to the signature UI flow.

Alternatively you can define a certificate file and password in `ToolManagerBuilder`. This will disable the additional signing flow for digital signatures and use the specified certificate instead.

{% tabs %}
{% tab title="Java" %}
{% code lineNumbers="true" %}

```java
ToolManagerBuilder tmBuilder = ToolManagerBuilder.from()
    .setUseDigitalSignature(true)
    // Optionally specify a default certificate file and password
    .setDigitalSignatureKeystorePath("my_keystore_path")
    .setDigitalSignatureKeystorePassword("my_keystore_password");
ViewerConfig.Builder builder = new ViewerConfig.Builder();
ViewerConfig config = builder
    //...
    .toolManagerBuilder(tmBuilder)
    .build();
```

{% endcode %}
{% endtab %}

{% tab title="Kotlin" %}
{% code lineNumbers="true" %}

```kotlin
val tmBuilder = ToolManagerBuilder.from()
  .setUseDigitalSignature(true)
  // Optionally specify a default certificate file and password
  .setDigitalSignatureKeystorePath("my_keystore_path")
  .setDigitalSignatureKeystorePassword("my_keystore_password")
val builder = ViewerConfig.Builder()
val config = builder
  //...
  .toolManagerBuilder(tmBuilder)
  .build()
```

{% endcode %}
{% endtab %}
{% endtabs %}

The signed document is then saved to a separate file.


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/android/digital-signature/digi-sig-tool.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
