list

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:    "list",
	Usage:   "List certificates issued",
	Aliases: []string{"ls"},
	Action: func(c *cli.Context) error {
		env := wcli.GlobalEnvironment

		profile, err := env.Profile()
		if err != nil {
			return err
		}

		db, err := issuedb.New(env.Randr, 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 {
			infotxt := certInfo([]byte(e.CertificatePEM))

			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
	},
}

FIXME[P2]: --all-profiles

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