issue

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigTemplateText = `` /* 2722-byte string literal not displayed */

Variables

View Source
var Command = &cli.Command{
	Name:  "issue",
	Usage: "Issue a new certificate or renew an existing certificate. Generates private key if needed.",
	Flags: append(structflags.MustPopulateFlagsFromStruct(Config{}),
		&cli.BoolFlag{
			Name:  "dump-template",
			Usage: "dump configuration template yaml without making actual changes",
		},
	),
	Action: func(c *cli.Context) error {
		env := action.GlobalEnvironment
		profile, err := env.Profile()
		if err != nil {
			return err
		}

		return ActionImpl(Local{Profile: profile}, c)
	},
}
View Source
var ErrCertKeyPathConflict = errors.New("Specified path conflicts with private key output path.")

Functions

func ActionImpl added in v0.1.0

func ActionImpl(strategy Strategy, c *cli.Context) error

func EnsurePrivateKey added in v0.1.0

func EnsurePrivateKey(env *action.Environment, ktype wcrypto.KeyType, privPath string) (crypto.PrivateKey, error)

func PrepareKeyTypePath added in v0.1.0

func PrepareKeyTypePath(env *action.Environment, ktype *wcrypto.KeyType, privPath *string) error

func PromptCertPath

func PromptCertPath(env *action.Environment, privPath, certPath string) (string, error)

func VerifyKeyType added in v0.1.0

func VerifyKeyType(path string, expected wcrypto.KeyType) (crypto.PublicKey, error)

Types

type CertStillValidErr added in v0.1.0

type CertStillValidErr struct {
	ValidLeft   time.Duration
	RenewBefore period.Days
}

func (CertStillValidErr) Error added in v0.1.0

func (e CertStillValidErr) Error() string

func (CertStillValidErr) ExitCode added in v0.2.2

func (CertStillValidErr) ExitCode() int

func (CertStillValidErr) Is added in v0.1.0

func (CertStillValidErr) Is(target error) bool

type Config

type Config struct {
	PrivateKeyPath string `yaml:"privateKeyPath" flags:"priv,private key input/output path,,path"`
	CertPath       string `yaml:"certPath" flags:"cert,cert input/output path,,path"`

	Issue *issue.Config `yaml:"issue" flags:""`

	RenewBefore period.Days `` /* 126-byte string literal not displayed */

	// This is here to avoid UnmarshalStrict throw error when noDefault was specified for ShouldLoadDefaults().
	XXX_NoDefault bool `yaml:"noDefault"`
}

func (*Config) Verify

func (c *Config) Verify(env *action.Environment) error

type IncompatibleCertErr added in v0.1.0

type IncompatibleCertErr struct {
	Wrap error
}

func (IncompatibleCertErr) Error added in v0.1.0

func (e IncompatibleCertErr) Error() string

func (IncompatibleCertErr) Is added in v0.1.0

func (IncompatibleCertErr) Is(target error) bool

func (IncompatibleCertErr) Unwrap added in v0.1.0

func (e IncompatibleCertErr) Unwrap() error

type Local added in v0.2.2

type Local struct {
	Profile *storage.Profile
}

func (Local) CASubject added in v0.2.2

func (l Local) CASubject(ctx context.Context, env *action.Environment) *dname.Config

func (Local) EnsureCA added in v0.2.2

func (l Local) EnsureCA(ctx context.Context, env *action.Environment) error

func (Local) Issue added in v0.2.2

func (Local) Issue(ctx context.Context, env *action.Environment, pub crypto.PublicKey, cfg *issue.Config) ([]byte, error)

type Strategy added in v0.2.2

type Strategy interface {
	EnsureCA(ctx context.Context, env *action.Environment) error
	CASubject(ctx context.Context, env *action.Environment) *dname.Config
	Issue(ctx context.Context, env *action.Environment, pub crypto.PublicKey, cfg *issue.Config) ([]byte, error)
}

Jump to

Keyboard shortcuts

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