function · Browser and Node

# signDocument

Signs a JSON object with an eddsa-jcs-2022 Data Integrity proof.

`@toip-tools/trust-core` · [View source](https://github.com/yourbuddyconner/toip-tools/blob/main/packages/trust-core/src/credentials.ts#L42)

Import:

```ts
import { signDocument } from "@toip-tools/trust-core";
```

## Declaration

Signature:

```ts
signDocument<T extends {
    issuer: string;
}>(doc: T, issuer: Identity, clock: Clock): T;
```

### Parameters

**`doc` (required)**

`T`

Document whose `issuer` must be the signing identity's DID.

**`issuer` (required)**

`Identity`

Identity that signs the document.

**`clock` (required)**

`Clock`

Supplies the proof's creation time.

### Returns

`T`

The signed document, including its proof.

[Usage guide](https://toip.tools/toolkit/trust-core/#usage) · [Error handling](https://toip.tools/toolkit/trust-core/#errors) · [All exports](https://toip.tools/toolkit/trust-core/api/)

---

This is the Markdown version of https://toip.tools/toolkit/trust-core/api/signDocument/. An index of the documentation for AI assistants is at https://toip.tools/llms.txt.
