title |
---|
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 genkey
is used to generate a private key.
Warning:
DO NOT transmit private keys over the Internet.
tiup mirror genkey [flags]
- 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_HOME
refers to the home directory of TiUP, which is$HOME/.tiup
by default.name
refers to the private key name that-n/--name
specifies. - Data type:
STRING
- Default: "private"
- 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/--public
is specified. If the private key specified in-n/--name
does 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 thetrue
value or do not pass any value.
- Saves the information of the public key as a file in the current directory. The file name is
{hash-prefix}-public.json
.hash-prefix
is 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 thetrue
value or do not pass any value.
- If
-p/--public
is not specified:- If the private key specified in
-n/--name
exists: TiUP outputsKey already exists, skipped
. - If the private key specified in
-n/--name
does not exist: TiUP outputsprivate key have been write to ${TIUP_HOME}/keys/{name}.json
.
- If the private key specified in
- If
-p/--public
is specified:- If the private key specified in
-n/--name
does not exist: TiUP reports the errorError: open ${TIUP_HOME}/keys/{name}.json: no such file or directory
. - If the private key specified in
-n/--name
exists: TiUP outputs the content of the corresponding public key.
- If the private key specified in