github.com/docker/docker-ce@v17.12.1-ce-rc2+incompatible/components/cli/docs/reference/commandline/trust_key_generate.md (about) 1 --- 2 title: "key generate" 3 description: "The key generate command description and usage" 4 keywords: "Key, notary, trust" 5 --- 6 7 <!-- This file is maintained within the docker/cli Github 8 repository at https://github.com/docker/cli/. Make all 9 pull requests against that repo. If you see this file in 10 another repository, consider it read-only there, as it will 11 periodically be overwritten by the definitive file. Pull 12 requests which include edits to this file in other repositories 13 will be rejected. 14 --> 15 16 # trust key generate 17 18 ```markdown 19 Usage: docker trust key generate NAME 20 21 Generate and load a signing key-pair 22 23 Options: 24 --dir string Directory to generate key in, defaults to current directory 25 --help Print usage 26 ``` 27 28 ## Description 29 30 `docker trust key generate` generates a key-pair to be used with signing, 31 and loads the private key into the local docker trust keystore. 32 33 `docker trust key generate` is currently experimental. 34 35 ## Examples 36 37 ### Generate a key-pair 38 39 ```bash 40 $ docker trust key generate alice 41 42 Generating key for alice... 43 Enter passphrase for new alice key with ID 17acf3c: 44 Repeat passphrase for new alice key with ID 17acf3c: 45 Successfully generated and loaded private key. Corresponding public key available: alice.pub 46 $ ls 47 alice.pub 48 49 ``` 50 51 The private signing key is encrypted by the passphrase and loaded into the docker trust keystore. 52 All passphrase requests to sign with the key will be referred to by the provided `NAME`. 53 54 The public key component `alice.pub` will be available in the current working directory, and can 55 be used directly by `docker trust signer add`. 56 57 Provide the `--dir` argument to specify a directory to generate the key in: 58 59 ```bash 60 $ docker trust key generate alice --dir /foo 61 62 Generating key for alice... 63 Enter passphrase for new alice key with ID 17acf3c: 64 Repeat passphrase for new alice key with ID 17acf3c: 65 Successfully generated and loaded private key. Corresponding public key available: alice.pub 66 $ ls /foo 67 alice.pub 68 69 ```