keygen

package
v0.78.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_KEY_LENGTH = 2048

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "keygen",
	Short:   "Genetate SSH private key",
	Aliases: []string{"gen", "g", "key", "keygen"},
	Args:    cobra.NoArgs,
	Run: func(c *cobra.Command, args []string) {
		var pub string
		var priv string
		var err error
		length := DEFAULT_KEY_LENGTH
		if FlagUseGo {

			pub, priv, err = ssh_utils.MakeSSHKeyPair()
			if err != nil {
				log.Fatalln(err)
			}
			fmt.Println(priv)
			fmt.Println(pub)
		} else {

			if FlagECDSA {
				pub, priv, err = ssh_utils.MakeSSHKeyPairSSHKeyGenECDSA()
			} else {
				pub, priv, err = ssh_utils.MakeSSHKeyPairSSHKeyGen(length)
			}
			if err != nil {
				log.Fatalln(err)
			}
			fmt.Println(priv)
			fmt.Println(pub)
		}
	},
}
View Source
var FlagECDSA bool
View Source
var FlagUseGo bool

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL