> For the complete documentation index, see [llms.txt](https://democrachain.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://democrachain.gitbook.io/docs/keys.md).

# 🔑 Keys

The main strength of the network is on it's keys

Keys are generated directly in the browser:

```javascript
const keyPair = await subtle.generateKey(
  {
    name: "RSA-PSS",
    modulusLength: 2048,
    publicExponent: new Uint8Array([1, 0, 1]),
    hash: "SHA-256",
  },
  true,
  ["sign", "verify"]
);
```

This creates a key pair of Public and Private keys.

* Public Ley: can be public and will be used to verify all signatures generated with this key-pair.
* Private Key: is private and not be shared.

For a new key to be allowed to add new blocks to the network, an existing entity (with the proper permissions) must add it through a block with the content:

```javascript
// ADD NEW USER

grantKey({
  name: "KEYNAME",
  pubKey:
    "-----BEGIN PUBLIC KEY----- MIIBIjANBgkqhki...IVizEoJZIz8JA9tkjZ+ZVPBfYlBQIDAQAB -----END PUBLIC KEY-----",
});

```
