MCPcopy Create free account
hub / github.com/cloudflare/cfssl / ocspdumpMain

Function ocspdumpMain

cli/ocspdump/ocspdump.go:28–47  ·  view source on GitHub ↗

ocspdumpMain is the main CLI of OCSP dump functionality.

(args []string, c cli.Config)

Source from the content-addressed store, hash-verified

26
27// ocspdumpMain is the main CLI of OCSP dump functionality.
28func ocspdumpMain(args []string, c cli.Config) error {
29 if c.DBConfigFile == "" {
30 return errors.New("need DB config file (provide with -db-config)")
31 }
32
33 db, err := dbconf.DBFromConfig(c.DBConfigFile)
34 if err != nil {
35 return err
36 }
37
38 dbAccessor := sql.NewAccessor(db)
39 records, err := dbAccessor.GetUnexpiredOCSPs()
40 if err != nil {
41 return err
42 }
43 for _, certRecord := range records {
44 fmt.Printf("%s\n", base64.StdEncoding.EncodeToString([]byte(certRecord.Body)))
45 }
46 return nil
47}
48
49// Command assembles the definition of Command 'ocspdump'
50var Command = &cli.Command{UsageText: ocspdumpUsageText, Flags: ocspdumpFlags, Main: ocspdumpMain}

Callers

nothing calls this directly

Calls 4

GetUnexpiredOCSPsMethod · 0.95
DBFromConfigFunction · 0.92
NewAccessorFunction · 0.92
NewMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…