cert

package
v5.57.2 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: MIT Imports: 14 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Certificate

type Certificate struct {
	// Certificate in ASN.1 DER format
	Certificate []byte
	// Private key in ASN.1 DER format
	PrivateKey []byte
}

func Generate

func Generate(parent *Certificate, opts ...Option) (*Certificate, error)

func MustGenerate

func MustGenerate(parent *Certificate, opts ...Option) *Certificate

func ParseCertificate

func ParseCertificate(certPEM []byte, keyPEM []byte) (*Certificate, error)

func (*Certificate) ToPEM

func (c *Certificate) ToPEM() ([]byte, []byte)

type Option

type Option func(*x509.Certificate)

func Authority

func Authority(isCA bool) Option

func CommonName

func CommonName(name string) Option

func DNSNames

func DNSNames(names ...string) Option

func IPAddresses added in v5.21.0

func IPAddresses(ip ...net.IP) Option

func KeyUsage

func KeyUsage(usage x509.KeyUsage) Option

func NotAfter

func NotAfter(t time.Time) Option

func NotBefore

func NotBefore(t time.Time) Option

func Organization

func Organization(org string) Option

Jump to

Keyboard shortcuts

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