Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cli.Command{ Name: "list", Usage: "List certificates issued", Aliases: []string{"ls"}, Flags: []cli.Flag{ &cli.BoolFlag{ Name: "profile", Aliases: []string{"p", "profiles"}, Usage: "Print list of profiles", }, }, Action: func(c *cli.Context) error { env := action.GlobalEnvironment slog := env.Logger.Sugar() if c.Bool("profile") { if err := LsProfile(env); err != nil { return err } return nil } profile, err := env.Profile() if err != nil { return err } now := env.NowImpl() st := profile.Status(now) if st.Code != storage.ValidCA { if st.Code == storage.Expired { slog.Warnf("Expired %s") } else { slog.Infof("Could not find a valid CA profile %q: %v", env.ProfileName, st) return nil } } db, err := issuedb.New(profile.IssueDBPath()) if err != nil { return err } es, err := db.Entries() if err != nil { return err } fmt.Printf(" YY/MM/DD YY/MM/DD\n") fmt.Printf("Status SerialNumber NotBefor NotAfter Subject\n") for _, e := range es { cert, err := e.ParseCertificate() var infotxt string if err != nil { infotxt = fmt.Sprintf("error: Failed to parse PEM: %v", err) } else { infotxt = CertInfo(cert) } switch e.State { case issuedb.IssueInProgress: fmt.Printf("issueing %19d\n", e.SerialNumber) case issuedb.ActiveCertificate: fmt.Printf("active %19d %s\n", e.SerialNumber, infotxt) } } return nil }, }
Functions ¶
func CertInfo ¶ added in v0.2.0
func CertInfo(c *x509.Certificate) string
func LsProfile ¶ added in v0.1.0
func LsProfile(env *action.Environment) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.