# get_signature · Rell standard library · Chromia Docs (concept)

> pure function get_ signature(data_ hash: byte_array , privkey: byte_array ): byte_array Sign a 32-byte array with a 32-byte private key using the ECDSA (se

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/crypto/get_signature/

FUNCTION

# get\_signature

```signature
pure function get_signature(data_hash: byte_array, privkey: byte_array): byte_array
```

Sign a 32-byte array with a 32-byte private key using the ECDSA (secp256k1) algorithm.

The given 32-byte array `data_hash` is typically a cryptographic hash obtained from a larger data
structure using a hashing function such as `hash()`, `sha256()` or `keccak256()`.

The returned value can be verified with `verify_signature()` using the public key belonging to the
keypair of the given private key.

**Parameters**

* **data\_hash** — a 32-byte array to be signed
* **privkey** — the 32-byte private key with which to sign

**Returns**

a 64-byte signature

**Throws**

* `exception` — if either `privkey` or `data_hash` are not exactly 32 bytes long

Since 0.13.11

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/crypto/get_signature.html)Generated API reference, mirrored from the live docs
