cert

package
v0.0.0-...-4a58531 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTrustedCert

func AddTrustedCert(certFile string) error

AddTrustedCert adds given the certificate the user's keychain.

func GenerateSelfSignedCert

func GenerateSelfSignedCert(opts Options) error

GenerateSelfSignedCert generates a self-signed X.509 certificate for testing purposes. It supports ECDSA curve P256 or RSA 2048 bits to generate the key. based on: https://golang.org/src/crypto/tls/generate_cert.go

Types

type Options

type Options struct {
	KeyFile   string        // path to the server private key file
	CertFile  string        // path to the fullchain certificate file
	Hosts     string        // comma-separated hostnames and IPs to generate a certificate for.
	ValidFrom time.Time     // creation date (default duration is 1 year)
	ValidFor  time.Duration // for how long the certificate is valid.
	KeyType   string        // default ECDSA curve P256
}

Options for generating a self-signed certificate.

Jump to

Keyboard shortcuts

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