business

package
v0.0.0-...-fbf7843 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotACertificate = errors.New("the file is not in a known format or does not contain a certificate")
)
View Source
var (
	ErrUserCancelled = errors.New("user cancelled input")
)

Functions

func LoadCertFromFile

func LoadCertFromFile(filepath string) (*x509.Certificate, error)

func NewCaCert

func NewCaCert(commonName string, name pkix.Name, opts ...CaCertOpt) (cert []byte, key []byte, err error)

func NewGeneratedCsr

func NewGeneratedCsr(commonName string, name pkix.Name, opts ...CsrOpt) (csr []byte, priv []byte, err error)

func PromptCertNameDetails

func PromptCertNameDetails() (pkix.Name, error)

func ShowCertDetails

func ShowCertDetails(file string) error

func SignCsr

func SignCsr(csrFile, caCertFile, caKeyFile string, certType CertType) ([]byte, string, error)

Types

type CaCertOpt

type CaCertOpt func(opts *CaCertOpts)

func CaExpirationDays

func CaExpirationDays(days int) CaCertOpt

func CaExpirationMonths

func CaExpirationMonths(months int) CaCertOpt

func CaIpAddress

func CaIpAddress(ip net.IP) CaCertOpt

func CaSubjectAlternativeName

func CaSubjectAlternativeName(name string) CaCertOpt

type CaCertOpts

type CaCertOpts struct {
	Name           pkix.Name
	ExpirationDate time.Time
	IpAddresses    []net.IP
	SANs           []string
	KeyBits        int
}

type CertType

type CertType int
const (
	CertTypeServerAuth CertType = iota
	CertTypeCA
	CertTypeClientAuth
)

type CsrOpt

type CsrOpt func(opts *csrOpts)

func CsrAddIP

func CsrAddIP(ip net.IP) CsrOpt

func CsrAddSan

func CsrAddSan(san string) CsrOpt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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