---
title: "Class: Signature"
canonical_url: "https://nimiq.dev/web-client/reference/classes/signature"
---
# Class: Signature

[@nimiq/core](../globals) / Signature

Defined in: @nimiq/core/types/wasm/web.d.ts:2070

An Ed25519 Signature represents a cryptographic proof that a private key signed some data.
It can be verified with the private key's public key.

## Methods

### __getClassname()

> **__getClassname**(): `string`

Defined in: @nimiq/core/types/wasm/web.d.ts:2074

#### Returns

`string`

---

### [dispose]()

> **[dispose]**(): `void`

Defined in: @nimiq/core/types/wasm/web.d.ts:2073

#### Returns

`void`

---

### free()

> **free**(): `void`

Defined in: @nimiq/core/types/wasm/web.d.ts:2072

#### Returns

`void`

---

### serialize()

> **serialize**(): `Uint8Array`

Defined in: @nimiq/core/types/wasm/web.d.ts:2098

Serializes the signature to a byte array.

#### Returns

`Uint8Array`

---

### toHex()

> **toHex**(): `string`

Defined in: @nimiq/core/types/wasm/web.d.ts:2102

Formats the signature into a hex string.

#### Returns

`string`

---

### create()

> `static` **create**(`private_key`, `public_key`, `data`): `Signature`

Defined in: @nimiq/core/types/wasm/web.d.ts:2078

Create a signature from a private key and its public key over byte data.

#### Parameters

##### private_key

[`PrivateKey`](PrivateKey)

##### public_key

[`PublicKey`](PublicKey)

##### data

`Uint8Array`

#### Returns

`Signature`

---

### deserialize()

> `static` **deserialize**(`bytes`): `Signature`

Defined in: @nimiq/core/types/wasm/web.d.ts:2084

Deserializes an Ed25519 signature from a byte array.

Throws when the byte array contains less than 64 bytes.

#### Parameters

##### bytes

`Uint8Array`

#### Returns

`Signature`

---

### fromAsn1()

> `static` **fromAsn1**(`bytes`): `Signature`

Defined in: @nimiq/core/types/wasm/web.d.ts:2088

Parses an Ed25519 signature from its ASN.1 representation.

#### Parameters

##### bytes

`Uint8Array`

#### Returns

`Signature`

---

### fromHex()

> `static` **fromHex**(`hex`): `Signature`

Defined in: @nimiq/core/types/wasm/web.d.ts:2094

Parses an Ed25519 signature from its hex representation.

Throws when the string is not valid hex format or when it represents less than 64 bytes.

#### Parameters

##### hex

`string`

#### Returns

`Signature`


## Sitemap

See the full [sitemap](https://nimiq.dev/sitemap.md) for all pages.
