Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var CACmd = &cobra.Command{
Use: "ca",
Short: "CA commands",
Long: `Manipulate CA`,
}
View Source
var CreateCACmd = &cobra.Command{ Use: "loadorcreate", Short: "Create a new CA and save in a secret", Long: `Create a new CA and save in a secret`, Run: func(cmd *cobra.Command, args []string) { myca := new(pki.CA) myca.SetupCA() err := myca.NewCA() if err != nil { log.Fatal(err) } if cafile != "" && cakeyfile != "" { err = myca.SaveToFile(cafile, cakeyfile) if err != nil { panic(err.Error()) } } else if cafile != "" || cakeyfile != "" { if err != nil { panic(errors.New("please use cafile and cakeyfile arguments")) } } else { if name == "" { name = utils.GetEnv("SECRETNAME", "micropki-ca") } namespace, err := vars.ValidateNamespace(namespace) if err != nil { panic(err.Error()) } err = myca.LoadFromSecret(name, namespace) if err != nil { log.Fatal("Secret can't be loaded") log.Fatal(err.Error()) err = myca.NewCA() if err != nil { panic(err.Error()) } err = myca.SaveToSecret(name, namespace) if err != nil { panic(err.Error()) } } } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.