cfssl: Index | Files | Directories

package cli

import ""

Package cli provides the template for adding new cfssl commands


Package Files

cli.go config.go

func PopFirstArgument Uses

func PopFirstArgument(args []string) (string, []string, error)

PopFirstArgument returns the first element and the rest of a string slice and return error if failed to do so. It is a helper function to parse non-flag arguments previously used in cfssl commands.

func PrintCRL Uses

func PrintCRL(certList []byte)

PrintCRL outputs the CRL to stdout

func PrintCert Uses

func PrintCert(key, csrBytes, cert []byte)

PrintCert outputs a cert, key and csr to stdout

func PrintOCSPResponse Uses

func PrintOCSPResponse(resp []byte)

PrintOCSPResponse outputs an OCSP response to stdout ocspResponse is base64 encoded

func ReadStdin Uses

func ReadStdin(filename string) ([]byte, error)

ReadStdin reads from stdin if the file is "-"

func RootFromConfig Uses

func RootFromConfig(c *Config) universal.Root

RootFromConfig returns a universal signer Root structure that can be used to produce a signer.

func Start Uses

func Start(cmds map[string]*Command) error

Start is the entrance point of cfssl command line tools.

type Command Uses

type Command struct {
    // The Usage Text
    UsageText string
    // Flags to look up in the global table
    Flags []string
    // Main runs the command, args are the arguments after flags
    Main func(args []string, c Config) error

Command holds the implementation details of a cfssl command.

type Config Uses

type Config struct {
    Hostname          string
    CertFile          string
    CSRFile           string
    CAFile            string
    CAKeyFile         string
    TLSCertFile       string
    TLSKeyFile        string
    MutualTLSCAFile   string
    MutualTLSCNRegex  string
    TLSRemoteCAs      string
    MutualTLSCertFile string
    MutualTLSKeyFile  string
    KeyFile           string
    IntermediatesFile string
    CABundleFile      string
    IntBundleFile     string
    Address           string
    Port              int
    MinTLSVersion     string
    Password          string
    ConfigFile        string
    CFG               *config.Config
    Profile           string
    IsCA              bool
    RenewCA           bool
    IntDir            string
    Flavor            string
    Metadata          string
    Domain            string
    IP                string
    Remote            string
    Label             string
    AuthKey           string
    ResponderFile     string
    ResponderKeyFile  string
    Status            string
    Reason            string
    RevokedAt         string
    Interval          time.Duration
    List              bool
    Family            string
    Timeout           time.Duration
    Scanner           string
    CSVFile           string
    NumWorkers        int
    MaxHosts          int
    Responses         string
    Path              string
    CRL               string
    Usage             string
    PGPPrivate        string
    PGPName           string
    Serial            string
    CNOverride        string
    AKI               string
    DBConfigFile      string
    CRLExpiration     time.Duration
    Disable           string

Config is a type to hold flag values used by cfssl commands.


bundlePackage bundle implements the bundle command.
certinfoPackage certinfo implements the certinfo command
crlPackage crl implements the crl command
gencertPackage gencert implements the gencert command.
gencrlPackage gencrl implements the gencrl command
gencsrPackage gencsr implements the gencsr command.
genkeyPackage genkey implements the genkey command.
infoPackage info implements the info command.
ocspdumpPackage ocspdump implements the ocspdump command.
ocsprefreshPackage ocsprefresh implements the ocsprefresh command.
ocspservePackage ocspserve implements the ocspserve function.
ocspsignPackage ocspsign implements the ocspsign command.
revokePackage revoke implements the revoke command.
selfsignPackage selfsign implements the selfsign command.
servePackage serve implements the serve command for CFSSL's API.
signPackage sign implements the sign command.
versionPackage version implements the version command.

Package cli imports 12 packages (graph) and is imported by 1096 packages. Updated 2020-11-16. Refresh now. Tools for package owners.