tlsutil

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	RSAKeySize   = 2048
	Duration365d = time.Hour * 24 * 365
)

Variables

This section is empty.

Functions

func EncodeCertificatePEM

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

func EncodePrivateKeyPEM

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

func EncodePublicKeyPEM

func EncodePublicKeyPEM(key *rsa.PublicKey) ([]byte, error)

func NewPrivateKey

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

func NewSelfSignedCACertificate

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

func NewSignedCertificate

func NewSignedCertificate(cfg CertConfig, key *rsa.PrivateKey, caCert *x509.Certificate, caKey *rsa.PrivateKey) (*x509.Certificate, error)

func ParsePEMEncodedCACert

func ParsePEMEncodedCACert(pemdata []byte) (*x509.Certificate, error)

func ParsePEMEncodedPrivateKey

func ParsePEMEncodedPrivateKey(pemdata []byte) (*rsa.PrivateKey, error)

Types

type AltNames

type AltNames struct {
	DNSNames []string
	IPs      []net.IP
}

AltNames contains the domain names and IP addresses that will be added to the API Server's x509 certificate SubAltNames field. The values will be passed directly to the x509.Certificate object.

type CertConfig

type CertConfig struct {
	CommonName   string
	Organization []string
	AltNames     AltNames
}

Jump to

Keyboard shortcuts

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