certutils

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: Apache-2.0 Imports: 12 Imported by: 1 module, 0 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

func NewCertificateAuthority

func NewCertificateAuthority(config *CertConfig) (*x509.Certificate, crypto.Signer, error)

NewCertificateAuthority creates new certificate and private key for the certificate authority

func NewPrivateKey

func NewPrivateKey() (crypto.Signer, error)

NewPrivateKey creates an RSA private key

func NewSelfSignedCACert

func NewSelfSignedCACert(key crypto.Signer, config *CertConfig) (*x509.Certificate, error)

NewSelfSignedCACert creates a CA certificate

func WriteCert

func WriteCert(path string, cert *x509.Certificate) error

WriteCert stores the given certificate at the given location

func WriteKey

func WriteKey(path string, key crypto.Signer) error

WriteKey stores the given key at the given location

Types

type CertConfig

type CertConfig struct {
	// CommonName is the subject name of the certificate
	CommonName string
	// ExpireDuration is the duration the certificate can be valid
	ExpireDuration time.Duration
}

CertConfig contains the basic fields required for creating a certificate

Jump to

Keyboard shortcuts

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