summaryrefslogtreecommitdiff
path: root/maint/keygen-openssh-test/README.md
blob: 415f2b62ff715817959e9a9399e475a1c73f17d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Generate test OpenSSH keys

The `crates/tor-keymgr/tesdata` test OpenSSH keys were generated with:

```bash
./maint/keygen-openssh-test/generate
```

## `keygen-open-ssh-test` usage

The `keygen-open-ssh-test` binary crate is a helper for
generating expanded-ed25519 and x25519 keys.

You shouldn't need to run `keygen-open-ssh-test` directly.
Instead, prefer using the provided `generate` script to
generate the test keys.

```
Generate an OpenSSH keypair

Usage: generate-custom [OPTIONS] --key-type <KEY_TYPE> --name <NAME>

Options:
      --key-type <KEY_TYPE>
          The type of key to generate.

          Options are `ed25519-expanded`, `x25519`.

          Possible values:
          - expanded-ed25519: An expanded Ed25519 key
          - x25519:           An X25519 key

      --algorithm <ALGORITHM>
          The algorithm name.

          If no algorithm is specified, it defaults to: * `[email protected]` for ed25519-expanded keys * `[email protected]` for x25519

      --comment <COMMENT>
          The comment

      --name <NAME>
          The output file name

      --public
          Whether to output a public key file

      --private
          Whether to output a private key file

  -h, --help
          Print help (see a summary with '-h')

  -V, --version
          Print version

```

### Example

Generate an expanded Ed25519 OpenSSH private key in `expanded-ed25519-ssh-key.private`:

```bash
cargo run -- --key-type expanded-ed25519 \
   --name expanded-ed25519-ssh-key \
   --private
```

Generate an X25519 OpenSSH private key in `x25519-ssh-key.private` that has the
algorithm set to `[email protected]` and the comment to `bar`:
```bash
cargo run -- --key-type x25519 \
   --algorithm [email protected] \
   --name x25519-ssh-key \
   --private \
   --comment bar
```