Help us shape the future of Go! Take the 2026 Go Developer Survey

tlsutil

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2016 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RSAKeySize = 2048
)

Variables

This section is empty.

Functions

func EncodeCertificatePEM added in v0.5.1

func EncodeCertificatePEM(cert *x509.Certificate) []byte

func EncodePrivateKeyPEM added in v0.5.1

func EncodePrivateKeyPEM(key *rsa.PrivateKey) []byte

func NewPrivateKey

func NewPrivateKey() (*rsa.PrivateKey, error)

func NewSelfSignedCACertificate

func NewSelfSignedCACertificate(cfg CACertConfig, key *rsa.PrivateKey) (*x509.Certificate, error)

func NewSignedClientCertificate

func NewSignedClientCertificate(cfg ClientCertConfig, key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, error)

func NewSignedServerCertificate

func NewSignedServerCertificate(cfg ServerCertConfig, key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, error)

Types

type CACertConfig

type CACertConfig struct {
	CommonName   string
	Organization string
	Duration     time.Duration
}

type ClientCertConfig

type ClientCertConfig struct {
	CommonName  string
	DNSNames    []string
	IPAddresses []string
	Duration    time.Duration
}

type ServerCertConfig

type ServerCertConfig struct {
	CommonName  string
	DNSNames    []string
	IPAddresses []string
	Duration    time.Duration
}

Jump to

Keyboard shortcuts

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