---
title: "Keys"
url: https://una-lang.org/en/docs/std/prelude/Keys/
release: v0.4.0
edition: "0.1 and later"
source: https://github.com/una-lang/una/blob/v0.4.0/docs/std/listing.json
---

# Keys

A capability of the prelude, in scope in every module. Edition 0.1 and later.

```una
pub capability Keys
  op hmac(key_name: Text, data: Text) -> internal Hashed
    fails KeyError
```

Computes an HMAC-SHA-256 with a named key of the grant's key file, as `internal` `Hashed`. It accepts `public` for `key_name` and any label for `data`, whose label its result carries (`spec/14 §3`, ADR 0039).

## Specification

- [`spec/14 §3`](https://una-lang.org/en/docs/spec/14-standard-library/#s3)

Generated from the standard modules of una v0.4.0 ([`docs/std/listing.json`](https://github.com/una-lang/una/blob/5fec93d88932b333feec25e589355a2cb34c37b5/docs/std/listing.json), which is not part of the specification). The specification governs: [`spec/14 §1`](https://una-lang.org/en/docs/spec/14-standard-library/#s1).
