@@ -442,6 +442,7 @@ var keyRotateCmd = &cmds.Command{
442
442
Tagline : "Rotates the ipfs identity." ,
443
443
ShortDescription : `
444
444
Generates a new ipfs identity and saves it to the ipfs config file.
445
+ Your existing identity key will be backed up in the Keystore.
445
446
The daemon must not be running when calling this command.
446
447
447
448
ipfs uses a repository in the local file system. By default, the repo is
@@ -453,7 +454,7 @@ environment variable:
453
454
},
454
455
Arguments : []cmds.Argument {},
455
456
Options : []cmds.Option {
456
- cmds .StringOption (oldKeyOptionName , "o" , "Keystore name for the old/rotated-out key. " ),
457
+ cmds .StringOption (oldKeyOptionName , "o" , "Keystore name to use for backing up your existing identity " ),
457
458
cmds .StringOption (keyStoreTypeOptionName , "t" , "type of the key to create: rsa, ed25519" ).WithDefault (keyStoreAlgorithmDefault ),
458
459
cmds .IntOption (keyStoreSizeOptionName , "s" , "size of the key to generate" ),
459
460
},
@@ -482,6 +483,9 @@ environment variable:
482
483
if ! ok {
483
484
return fmt .Errorf ("keystore name for backing up old key must be provided" )
484
485
}
486
+ if oldKey == "self" {
487
+ return fmt .Errorf ("keystore name for back up cannot be named 'self'" )
488
+ }
485
489
return doRotate (os .Stdout , cctx .ConfigRoot , oldKey , algorithm , nBitsForKeypair , nBitsGiven )
486
490
},
487
491
}
0 commit comments