issue

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: 17 Imported by: 0

Documentation

Index

Constants

View Source
const NotAfterLayout = "20060102"

Variables

View Source
var FarFuture = ValidityPeriod{
	Days: 0,

	NotAfter: time.Date(2099, 12, 31, 23, 59, 0, 0, time.UTC),
}

Functions

func Run

func Run(env *cli.Environment, pub crypto.PublicKey, cfg *Config) ([]byte, error)

FIXME[P2]: make concurrent safe

Types

type Config

type Config struct {
	Subject  *dname.Config     `yaml:"subject" flags:""`
	Names    san.Names         `yaml:"subjectAltNames" flags:"subject-alt-name,set cert subjectAltNames,san"`
	KeyUsage keyusage.KeyUsage `yaml:"keyUsage" flags:"key-usage,what the key/cert is used for (tlsServer, tlsClient, tlsClientServer),ku"`
	Validity ValidityPeriod    `yaml:"validity" flags:"validity,time duration/timestamp where the cert is valid to (examples: 30d, 1y, 20220530)"`
	KeyType  wcrypto.KeyType   `yaml:"keyType" flags:"key-type,private key type (rsa, rcdsa),t"`

	// Don't create issuedb entry.
	NoIssueDBEntry bool
}

func ConfigFromCert

func ConfigFromCert(cert *x509.Certificate) *Config

func DefaultConfig

func DefaultConfig(env *cli.Environment) (*Config, error)

func (*Config) Verify

func (cfg *Config) Verify() error

type ValidityPeriod

type ValidityPeriod struct {
	// Days specifies the number of days that the issued cert would be valid for.
	// Days count is ignored if NotAfter is specified to non-zero.
	Days uint

	// NotAfter specifies the timestamp where the cert is considered valid to (inclusive).
	NotAfter time.Time
}

func (ValidityPeriod) GetNotAfter

func (p ValidityPeriod) GetNotAfter(base time.Time) time.Time

func (ValidityPeriod) String

func (p ValidityPeriod) String() string

func (*ValidityPeriod) UnmarshalFlag

func (p *ValidityPeriod) UnmarshalFlag(s string) error

func (*ValidityPeriod) UnmarshalYAML

func (p *ValidityPeriod) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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