show

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Command = &cli.Command{
	Name:  "show",
	Usage: "Show CA status, an existing certificate and/or its key.",
	UsageText: `kmgm show ca                --- Show the CA certificate.
   kmgm show [serialprefix]    --- Show certificate which has a serial number starting from given prefix.`,
	Flags: []cli.Flag{
		&cli.StringFlag{
			Name:    "output",
			Aliases: []string{"o"},
			Usage:   "Output format. (full, pem)",
			Value:   "full",
		},
		&cli.StringFlag{
			Name:    "file",
			Aliases: []string{"f"},
			Usage:   "Write output to specified file.",
			Value:   "-",
		},
	},
	Action: ActionImpl(FindCertificateWithPrefix),
}

Functions

func ActionImpl added in v0.2.1

func ActionImpl(findCertificateWithPrefixImpl FindCertificateWithPrefixType) func(*cli.Context) error

func FindCertificateWithPrefix

func FindCertificateWithPrefix(ctx context.Context, env *action.Environment, prefix string) (*x509.Certificate, error)

func HexStr

func HexStr(bs []byte) string

func PrintCertInfo

func PrintCertInfo(w io.Writer, cert *x509.Certificate, ft FormatType)

Types

type FindCertificateWithPrefixType added in v0.2.1

type FindCertificateWithPrefixType func(ctx context.Context, env *action.Environment, prefix string) (*x509.Certificate, error)

type FormatType

type FormatType int
const (
	FormatFull FormatType = iota
	FormatPEM
)

func FormatTypeFromString

func FormatTypeFromString(s string) (FormatType, error)

func (FormatType) ShouldOutputInfo

func (t FormatType) ShouldOutputInfo() bool

func (FormatType) ShouldOutputPEM

func (t FormatType) ShouldOutputPEM() bool

func (FormatType) String

func (t FormatType) String() string

type IfChangedWriteFile

type IfChangedWriteFile struct {
	// contains filtered or unexported fields
}

func NewIfChangedWriteFile

func NewIfChangedWriteFile(path string) (*IfChangedWriteFile, error)

func (*IfChangedWriteFile) Close

func (wf *IfChangedWriteFile) Close() error

func (*IfChangedWriteFile) Write

func (wf *IfChangedWriteFile) Write(bs []byte) (int, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL