tiup mirror genkey
TiUP mirror, according its definition, has three roles of users:
Mirror administrators: They have the permission to modify
root.json,index.json,snapshot.json, andtimestamp.json.Component owners: They have the permission to modify the corresponding component.
Normal users: They can download and use the components.
Because TiUP requires the signature of the corresponding owner/administrator to modify a file, owners/administrators must have his or her own private key. The command
tiup mirror genkeyis used to generate a private key.
Syntax
tiup mirror genkey [flags]
Options
-n, --name
- Specifies the name of the key, which also determines the name of the final generated file. The path of the generated private key file is
${TIUP_HOME}/keys/{name}.json.TIUP_HOMErefers to the home directory of TiUP, which is$HOME/.tiupby default.namerefers to the private key name that-n/--namespecifies. - Data type:
STRING - Default: "private"
-p, --public
- Shows the corresponding public key of the private key specified in the option
-n/--name. - TiUP does not create a new private key when
-p/--publicis specified. If the private key specified in-n/--namedoes not exist, TiUP returns an error. - Data type:
BOOLEAN - This option is disabled by default and its default value is
false. To enable this option, you can add this option to the command, and pass thetruevalue or do not pass any value.
--save
- Saves the information of the public key as a file in the current directory. The file name is
{hash-prefix}-public.json.hash-prefixis the first 16 bits of the key ID. - Data type:
BOOLEAN - This option is disabled by default and its default value is
false. To enable this option, you can add this option to the command, and pass thetruevalue or do not pass any value.
Outputs
- If
-p/--publicis not specified:- If the private key specified in
-n/--nameexists: TiUP outputsKey already exists, skipped. - If the private key specified in
-n/--namedoes not exist: TiUP outputsprivate key have been write to ${TIUP_HOME}/keys/{name}.json.
- If the private key specified in
- If
-p/--publicis specified:- If the private key specified in
-n/--namedoes not exist: TiUP reports the errorError: open ${TIUP_HOME}/keys/{name}.json: no such file or directory. - If the private key specified in
-n/--nameexists: TiUP outputs the content of the corresponding public key.
- If the private key specified in
Was this page helpful?