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: 0

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