github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/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  # trust key generate
     8  
     9  ```markdown
    10  Usage:  docker trust key generate NAME
    11  
    12  Generate and load a signing key-pair
    13  
    14  Options:
    15        --dir string   Directory to generate key in, defaults to current directory
    16        --help         Print usage
    17  ```
    18  
    19  ## Description
    20  
    21  `docker trust key generate` generates a key-pair to be used with signing,
    22   and loads the private key into the local docker trust keystore.
    23  
    24  ## Examples
    25  
    26  ### Generate a key-pair
    27  
    28  ```bash
    29  $ docker trust key generate alice
    30  
    31  Generating key for alice...
    32  Enter passphrase for new alice key with ID 17acf3c:
    33  Repeat passphrase for new alice key with ID 17acf3c:
    34  Successfully generated and loaded private key. Corresponding public key available: alice.pub
    35  $ ls
    36  alice.pub
    37  ```
    38  
    39  The private signing key is encrypted by the passphrase and loaded into the docker trust keystore.
    40  All passphrase requests to sign with the key will be referred to by the provided `NAME`.
    41  
    42  The public key component `alice.pub` will be available in the current working directory, and can
    43  be used directly by `docker trust signer add`.
    44  
    45  Provide the `--dir` argument to specify a directory to generate the key in:
    46  
    47  ```bash
    48  $ docker trust key generate alice --dir /foo
    49  
    50  Generating key for alice...
    51  Enter passphrase for new alice key with ID 17acf3c:
    52  Repeat passphrase for new alice key with ID 17acf3c:
    53  Successfully generated and loaded private key. Corresponding public key available: alice.pub
    54  $ ls /foo
    55  alice.pub
    56  ```