# keygen · Chromia Docs (concept)

> The keygen command (pmc keygen) generates a public and private key pair. An elliptic curve secp256k1 generates these keys.

Source: https://docs.chromia.com/ecosystem/providers/pmc/commands/keygen/

# keygen

Plain text

```
Usage: pmc keygen [OPTIONS]

  Generates public/private key pair

╭─ File format ───────────────────────────────────────────────────────────────╮
│  -s, --save=PATH  File to save the generated keypair in                     │
│  --key-id=VALUE   Name the generated key with an id                         │
╰─────────────────────────────────────────────────────────────────────────────╯
╭─ Options ───────────────────────────────────────────────────────────────────╮
│  -m, --mnemonic=TEXT    Mnemonic word list, words separated by space, e.g:  │
│                         "lift employ roast rotate liar holiday sun fever    │
│                         output magnet...""                                  │
│  -n, --node             Save the generated keypair in format to be included │
│                         in node properties file                             │
│  -pm, --print-mnemonic  Print the generated mnemonic                        │
│  -h, --help             Show this message and exit                          │
╰─────────────────────────────────────────────────────────────────────────────╯
```

The keygen command (`pmc keygen`) generates a public and private key pair. An elliptic curve `secp256k1` generates these
keys.

* Saves the key pair in a file named `.secret`.

Terminal

```
pmc keygen --save .secret
```

* Generates a key pair from a mnemonic phrase and saves it to a file named `.secret`.

Terminal

```
pmc keygen --save .secret --mnemonic "march aspect beef treat ..."
```

* Generates a keypair that PMC uses when commands are executed from this directory.

Terminal

```
pmc keygen --save .chromia/config
```

* Generates a keypair that PMC uses when commands are executed from this host (global config).

Terminal

```
pmc keygen --save ~/.chromia/config
```

* Generates a keypair with an ID, stored in `~/.chromia/`.

Terminal

```
pmc keygen --key-id secret
```

This key ID can then be used in configuration files:

Properties

```
key.id = secret
```

[View this page on docs.chromia.com](https://docs.chromia.com/ecosystem/providers/pmc/commands/keygen/)Content mirrored from the live docs
