Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CreateKey = &cobra.Command{ Use: "create-key", Short: "create a SSH key", Long: `Perform secure SSH key generation. `, Run: func(cmd *cobra.Command, args []string) { p, err := utils.LoadPersona(cmd) if err != nil { ui.Fatal(err, 1) } passphrase := utils.GeneratePassphrase() ui.Infof(fmt.Sprintf("Generated passphrase: %s", passphrase)) genCmd := "ssh-keygen" genArgs := []string{ "-t", "ed25519", "-a", "100", "-N", passphrase, "-C", p.Config.GetString("identity.email"), "-f", path.Join(p.Location(), pluginName, "id_rsa"), } c := exec.Command(genCmd, genArgs...) out, err := c.Output() if err != nil { ui.Error(err) var eerr *exec.ExitError if errors.As(err, &eerr) { ui.Error(err) } os.Exit(1) } ui.Outputf(string(out)) }, }
View Source
var PrintPubKey = &cobra.Command{ Use: "print-pubkey", Short: "Print public key", Long: `Print SSH public key to be reused or copied outside of devid. `, Run: func(cmd *cobra.Command, args []string) { p, err := utils.LoadPersona(cmd) if err != nil { ui.Fatal(err, 1) } pubKeyLocatin := path.Join(p.Location(), pluginName, "id_rsa.pub") dat, err := os.ReadFile(pubKeyLocatin) if err != nil { ui.Error(err) } ui.Outputf(string(dat)) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.